Package org.robolectric.shadows
Class ShadowPausedSystemClock
- java.lang.Object
-
- org.robolectric.shadows.ShadowSystemClock
-
- org.robolectric.shadows.ShadowPausedSystemClock
-
@Implements(value=android.os.SystemClock.class, isInAndroidSdk=false, shadowPicker=Picker.class) public class ShadowPausedSystemClock extends ShadowSystemClock
A shadow SystemClock used whenLooperMode.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()
andSystemClock.currentThreadTimeMillis()
are identical.This class should not be referenced directly. Use ShadowSystemClock instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowSystemClock
ShadowSystemClock.Picker
-
-
Field Summary
-
Fields inherited from class org.robolectric.shadows.ShadowSystemClock
networkTimeAvailable
-
-
Constructor Summary
Constructors Constructor Description ShadowPausedSystemClock()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class org.robolectric.shadows.ShadowSystemClock
advanceBy, advanceBy, currentGnssTimeClock, currentTimeMillis, nanoTime, setGnssTimeAvailable, setNanoTime, setNetworkTimeAvailable
-
-
-
-
Method Detail
-
sleep
@Implementation protected static void sleep(long millis)
Advances the current time by given millis, without sleeping the current thread/
-
setCurrentTimeMillis
@Implementation protected static boolean setCurrentTimeMillis(long millis)
Sets the current wall time.Currently does not perform any permission checks.
- Returns:
- false if specified time is less than current time.
-
uptimeMillis
@Implementation protected static long uptimeMillis()
-
elapsedRealtime
@Implementation protected static long elapsedRealtime()
-
elapsedRealtimeNanos
@Implementation(minSdk=17) protected static long elapsedRealtimeNanos()
-
currentThreadTimeMillis
@Implementation protected static long currentThreadTimeMillis()
-
currentThreadTimeMicro
@HiddenApi @Implementation protected static long currentThreadTimeMicro()
-
currentTimeMicro
@HiddenApi @Implementation protected static long currentTimeMicro()
-
currentNetworkTimeMillis
@Implementation(minSdk=28) @HiddenApi protected static long currentNetworkTimeMillis()
-
reset
@Resetter public static void reset()
-
-