Commit 8d131cad by christosts Committed by Oliver Woodman

Fix flaky AsynchronousMediaCodecAdapterTest

The test was incorrectly assuming that with LooperMode.PAUSE,
HandlerThread instances needed explicit calls to execute
tasks. This commit fixes the test flakiness by manually pausing the
HandlerThead when needed.

PiperOrigin-RevId: 319411552
parent 31efd538
......@@ -21,7 +21,6 @@ import android.media.MediaCrypto;
import android.media.MediaFormat;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.view.Surface;
import androidx.annotation.GuardedBy;
import androidx.annotation.IntDef;
......@@ -251,19 +250,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
}
@VisibleForTesting
/* package */ void onMediaCodecError(IllegalStateException e) {
synchronized (lock) {
mediaCodecAsyncCallback.onMediaCodecError(e);
}
}
@VisibleForTesting
@Nullable
/* package */ Looper getLooper() {
return handlerThread.getLooper();
}
private void onFlushCompleted() {
synchronized (lock) {
onFlushCompletedSynchronized();
......
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