@Implements(value=android.os.SystemClock.class, shadowPicker=ShadowSystemClock.Picker.class, isInAndroidSdk=false) public class ShadowLegacySystemClock extends ShadowSystemClock
A shadow SystemClock for LooperMode.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.
ShadowSystemClock.Picker
networkTimeAvailable
Constructor and Description |
---|
ShadowLegacySystemClock() |
Modifier and Type | Method and Description |
---|---|
protected static long |
currentNetworkTimeMillis() |
static long |
currentThreadTimeMicro() |
protected static long |
currentThreadTimeMillis() |
static long |
currentTimeMicro() |
static long |
currentTimeMillis()
Implements
System.currentTimeMillis() through ShadowWrangler. |
protected static long |
elapsedRealtime() |
protected static long |
elapsedRealtimeNanos() |
static long |
nanoTime()
Implements
System.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() |
advanceBy, setNetworkTimeAvailable
@Implementation protected static void sleep(long millis)
@Implementation protected static boolean setCurrentTimeMillis(long millis)
@Implementation protected static long uptimeMillis()
@Implementation protected static long elapsedRealtime()
@Implementation(minSdk=17) protected static long elapsedRealtimeNanos()
@Implementation protected static long currentThreadTimeMillis()
@HiddenApi @Implementation public static long currentThreadTimeMicro()
@HiddenApi @Implementation public static long currentTimeMicro()
public static long currentTimeMillis()
Implements System.currentTimeMillis()
through ShadowWrangler.
public static long nanoTime()
Implements System.nanoTime()
through ShadowWrangler.
public static void setNanoTime(long nanoTime)
@Implementation(minSdk=28) @HiddenApi protected static long currentNetworkTimeMillis()
@Resetter public static void reset()