@Implements(value=android.os.SystemClock.class, shadowPicker=Picker.class, isInAndroidSdk=false) public class ShadowLegacySystemClock extends ShadowSystemClock
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 | Description |
---|---|
ShadowLegacySystemClock() |
Modifier and Type | Method | 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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
advanceBy, currentGnssTimeClock, setGnssTimeAvailable, 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()
System.currentTimeMillis()
through ShadowWrangler.public static long nanoTime()
System.nanoTime()
through ShadowWrangler.public static void setNanoTime(long nanoTime)
@Implementation(minSdk=28) @HiddenApi protected static long currentNetworkTimeMillis()
@Resetter public static void reset()