@Implements(value=android.os.MessageQueue.class, isInAndroidSdk=false) public class ShadowLegacyMessageQueue extends ShadowMessageQueue
MessageQueue for LooperMode.Mode.LEGACY.
In LooperMode.Mode.LEGACY Robolectric puts Messages into the
scheduler queue instead of sending them to be handled on a separate thread. Messages that are scheduled to be dispatched can be triggered by calling ShadowLooper.idleMainLooper().
ShadowLooperShadowMessageQueue.Picker| Constructor | Description |
|---|---|
ShadowLegacyMessageQueue() |
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
enqueueMessage(Message msg,
long when) |
|
Message |
getHead() |
Retrieves the current Message at the top of the queue.
|
Scheduler |
getScheduler() |
Return this queue's Scheduler.
|
static void |
nativeDestroy(int ptr) |
|
protected static void |
nativeDestroy(long ptr) |
|
static Number |
nativeInit() |
|
static boolean |
nativeIsIdling(int ptr) |
|
protected static boolean |
nativeIsIdling(long ptr) |
|
protected void |
removeSyncBarrier(int token) |
|
void |
reset() |
Reset the messageQueue state.
|
void |
setHead(Message msg) |
Sets the current Message at the top of the queue.
|
void |
setScheduler(Scheduler scheduler) |
Set this queue's Scheduler.
|
@HiddenApi @Implementation public static Number nativeInit()
@HiddenApi @Implementation(minSdk=18, maxSdk=20) public static void nativeDestroy(int ptr)
@Implementation(minSdk=21) protected static void nativeDestroy(long ptr)
@HiddenApi @Implementation(minSdk=19, maxSdk=20) public static boolean nativeIsIdling(int ptr)
@Implementation(minSdk=21, maxSdk=22) protected static boolean nativeIsIdling(long ptr)
public Scheduler getScheduler()
ShadowMessageQueueOnly supported in LooperMode.Mode.LEGACY.
getScheduler in class ShadowMessageQueuepublic void setScheduler(Scheduler scheduler)
ShadowMessageQueueOnly supported in LooperMode.Mode.LEGACY.
setScheduler in class ShadowMessageQueuepublic Message getHead()
ShadowMessageQueueOnly supported in LooperMode.Mode.LEGACY.
getHead in class ShadowMessageQueuepublic void setHead(Message msg)
ShadowMessageQueueOnly supported in LooperMode.Mode.LEGACY.
setHead in class ShadowMessageQueuepublic void reset()
ShadowMessageQueuereset in class ShadowMessageQueue@Implementation protected boolean enqueueMessage(Message msg, long when)
@Implementation @HiddenApi protected void removeSyncBarrier(int token)