Package org.robolectric.shadows
Class ShadowLegacySystemClock
- java.lang.Object
-
- org.robolectric.shadows.ShadowSystemClock
-
- org.robolectric.shadows.ShadowLegacySystemClock
-
@Implements(value=android.os.SystemClock.class, shadowPicker=Picker.class, isInAndroidSdk=false) public class ShadowLegacySystemClock extends ShadowSystemClock
A shadow SystemClock forLooperMode.Mode.LEGACY
In LEGACY LooperMode, Robolectric's concept of current time is base on the current time of the UI Scheduler for consistency with previous implementations. This is not ideal, since both schedulers (background and foreground), can see different values for the current time.
-
-
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 ShadowLegacySystemClock()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static long
currentNetworkTimeMillis()
static long
currentThreadTimeMicro()
protected static long
currentThreadTimeMillis()
static long
currentTimeMicro()
static long
currentTimeMillis()
ImplementsSystem.currentTimeMillis()
through ShadowWrangler.protected static long
elapsedRealtime()
protected static long
elapsedRealtimeNanos()
static long
nanoTime()
ImplementsSystem.nanoTime()
through ShadowWrangler.static void
reset()
protected static boolean
setCurrentTimeMillis(long millis)
static void
setNanoTime(long nanoTime)
protected static void
sleep(long millis)
protected static long
uptimeMillis()
-
Methods inherited from class org.robolectric.shadows.ShadowSystemClock
advanceBy, advanceBy, currentGnssTimeClock, setGnssTimeAvailable, setNetworkTimeAvailable
-
-
-
-
Method Detail
-
sleep
@Implementation protected static void sleep(long millis)
-
setCurrentTimeMillis
@Implementation protected static boolean setCurrentTimeMillis(long millis)
-
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 public static long currentThreadTimeMicro()
-
currentTimeMicro
@HiddenApi @Implementation public static long currentTimeMicro()
-
currentTimeMillis
public static long currentTimeMillis()
ImplementsSystem.currentTimeMillis()
through ShadowWrangler.- Returns:
- Current time in millis.
-
nanoTime
public static long nanoTime()
ImplementsSystem.nanoTime()
through ShadowWrangler.- Returns:
- Current time with nanos.
-
setNanoTime
public static void setNanoTime(long nanoTime)
-
currentNetworkTimeMillis
@Implementation(minSdk=28) @HiddenApi protected static long currentNetworkTimeMillis()
-
reset
@Resetter public static void reset()
-
-