mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00
Execute actions in action schedule immediately.
Run next action immediately without using the handler when the requested delay is zero. This ensures that no other code can run between these two actions to improve deterministic test behaviour. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=170456852
This commit is contained in:
parent
28173991d1
commit
096d7651d2
@ -16,6 +16,7 @@
|
||||
package com.google.android.exoplayer2.testutil;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Surface;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
@ -342,7 +343,11 @@ public final class ActionSchedule {
|
||||
this.trackSelector = trackSelector;
|
||||
this.surface = surface;
|
||||
this.mainHandler = mainHandler;
|
||||
clock.postDelayed(mainHandler, this, delayMs);
|
||||
if (delayMs == 0 && Looper.myLooper() == mainHandler.getLooper()) {
|
||||
run();
|
||||
} else {
|
||||
clock.postDelayed(mainHandler, this, delayMs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user