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 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowSystemClock
ShadowSystemClock.Picker -
Field Summary
-
Constructor Summary
Constructors Constructor Description ShadowPausedSystemClock() -
Method Summary
Modifier and Type Method Description protected static longcurrentNetworkTimeMillis()protected static longcurrentThreadTimeMicro()protected static longcurrentThreadTimeMillis()protected static longcurrentTimeMicro()protected static longelapsedRealtime()protected static longelapsedRealtimeNanos()static voidreset()protected static booleansetCurrentTimeMillis(long millis)Sets the current wall time.protected static voidsleep(long millis)Advances the current time by given millis, without sleeping the current thread/protected static longuptimeMillis()Methods inherited from class org.robolectric.shadows.ShadowSystemClock
advanceBy, advanceBy, currentGnssTimeClock, currentTimeMillis, nanoTime, setGnssTimeAvailable, setNanoTime, setNetworkTimeAvailable
-
Constructor Details
-
ShadowPausedSystemClock
public ShadowPausedSystemClock()
-
-
Method Details
-
sleep
Advances the current time by given millis, without sleeping the current thread/ -
setCurrentTimeMillis
Sets the current wall time.Currently does not perform any permission checks.
- Returns:
- false if specified time is less than current time.
-
uptimeMillis
-
elapsedRealtime
-
elapsedRealtimeNanos
-
currentThreadTimeMillis
-
currentThreadTimeMicro
-
currentTimeMicro
-
currentNetworkTimeMillis
-
reset
-