@Implements(value=android.os.SystemClock.class, isInAndroidSdk=false, shadowPicker=ShadowSystemClock.Picker.class) public class ShadowPausedSystemClock extends ShadowSystemClock
A shadow SystemClock used when LooperMode.Mode.PAUSED
is active.
In this variant, there is just one global system time controlled by this class. The current time is fixed in place, and manually advanced by calling SystemClock.setCurrentTimeMillis(long)
SystemClock.uptimeMillis()
and SystemClock.currentThreadTimeMillis()
are identical.
This class should not be referenced directly. Use ShadowSystemClock instead.
ShadowSystemClock.Picker
networkTimeAvailable
Constructor and Description |
---|
ShadowPausedSystemClock() |
Modifier and Type | Method and Description |
---|---|
protected static long |
currentNetworkTimeMillis() |
protected static long |
currentThreadTimeMicro() |
protected static long |
currentThreadTimeMillis() |
protected static long |
currentTimeMicro() |
protected static long |
elapsedRealtime() |
protected static long |
elapsedRealtimeNanos() |
static void |
reset() |
protected static boolean |
setCurrentTimeMillis(long millis)
Sets the current wall time.
|
protected static void |
sleep(long millis)
Advances the current time by given millis, without sleeping the current thread/
|
protected static long |
uptimeMillis() |
advanceBy, currentTimeMillis, nanoTime, setNanoTime, setNetworkTimeAvailable
@Implementation protected static void sleep(long millis)
Advances the current time by given millis, without sleeping the current thread/
@Implementation protected static boolean setCurrentTimeMillis(long millis)
Sets the current wall time.
Currently does not perform any permission checks.
@Implementation protected static long uptimeMillis()
@Implementation protected static long elapsedRealtime()
@Implementation(minSdk=17) protected static long elapsedRealtimeNanos()
@Implementation protected static long currentThreadTimeMillis()
@HiddenApi @Implementation protected static long currentThreadTimeMicro()
@HiddenApi @Implementation protected static long currentTimeMicro()
@Implementation(minSdk=28) @HiddenApi protected static long currentNetworkTimeMillis()
@Resetter public static void reset()