Commit 363c9a98 by ibaker Committed by Ian Baker

Remove statically initialized SessionResult

SessionResult stores SystemClock.elapsedRealtime() into
this.completionTimeMs, so a statically initialized instance will have
a meaningless value.

PiperOrigin-RevId: 407865809
parent 42967290
...@@ -158,8 +158,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; ...@@ -158,8 +158,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
@SuppressWarnings("FutureReturnValueIgnored") // TODO(b/138091975): Not to ignore if feasible @SuppressWarnings("FutureReturnValueIgnored") // TODO(b/138091975): Not to ignore if feasible
/* package */ class MediaControllerImplBase implements MediaControllerImpl { /* package */ class MediaControllerImplBase implements MediaControllerImpl {
private static final SessionResult RESULT_WHEN_CLOSED = new SessionResult(RESULT_INFO_SKIPPED);
public static final String TAG = "MCImplBase"; public static final String TAG = "MCImplBase";
final MediaController instance; final MediaController instance;
...@@ -383,7 +381,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; ...@@ -383,7 +381,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
IMediaSession iSession, RemoteSessionTask task) { IMediaSession iSession, RemoteSessionTask task) {
if (iSession != null) { if (iSession != null) {
SequencedFutureManager.SequencedFuture<SessionResult> result = SequencedFutureManager.SequencedFuture<SessionResult> result =
sequencedFutureManager.createSequencedFuture(RESULT_WHEN_CLOSED); sequencedFutureManager.createSequencedFuture(new SessionResult(RESULT_INFO_SKIPPED));
try { try {
task.run(iSession, result.getSequenceNumber()); task.run(iSession, result.getSequenceNumber());
} catch (RemoteException e) { } catch (RemoteException e) {
......
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