Commit b4492695 by andrewlewis Committed by Oliver Woodman

Remove Objects.equals use from CronetDataSource

Objects was added in API 19.

PiperOrigin-RevId: 253567490
parent 1266d596
...@@ -32,6 +32,7 @@ import com.google.android.exoplayer2.util.Clock; ...@@ -32,6 +32,7 @@ import com.google.android.exoplayer2.util.Clock;
import com.google.android.exoplayer2.util.ConditionVariable; import com.google.android.exoplayer2.util.ConditionVariable;
import com.google.android.exoplayer2.util.Log; import com.google.android.exoplayer2.util.Log;
import com.google.android.exoplayer2.util.Predicate; import com.google.android.exoplayer2.util.Predicate;
import com.google.android.exoplayer2.util.Util;
import java.io.IOException; import java.io.IOException;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import java.net.UnknownHostException; import java.net.UnknownHostException;
...@@ -40,7 +41,6 @@ import java.util.Collections; ...@@ -40,7 +41,6 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -759,7 +759,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource { ...@@ -759,7 +759,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
} catch (InterruptedException e) { } catch (InterruptedException e) {
// The operation is ongoing so replace buffer to avoid it being written to by this // The operation is ongoing so replace buffer to avoid it being written to by this
// operation during a subsequent request. // operation during a subsequent request.
if (Objects.equals(buffer, readBuffer)) { if (Util.areEqual(buffer, readBuffer)) {
readBuffer = null; readBuffer = null;
} }
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
...@@ -770,7 +770,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource { ...@@ -770,7 +770,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {
// The operation is ongoing so replace buffer to avoid it being written to by this // The operation is ongoing so replace buffer to avoid it being written to by this
// operation during a subsequent request. // operation during a subsequent request.
if (Objects.equals(buffer, readBuffer)) { if (Util.areEqual(buffer, readBuffer)) {
readBuffer = null; readBuffer = null;
} }
throw new HttpDataSourceException( throw new HttpDataSourceException(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment