Package org.robolectric.shadows
Class ShadowLegacyMessageQueue
java.lang.Object
org.robolectric.shadows.ShadowMessageQueue
org.robolectric.shadows.ShadowLegacyMessageQueue
@Implements(value=android.os.MessageQueue.class, isInAndroidSdk=false) public class ShadowLegacyMessageQueue extends ShadowMessageQueue
The shadow
MessageQueue
for LooperMode.Mode.LEGACY
.
In LooperMode.Mode.LEGACY
Robolectric puts Message
s into the
scheduler queue instead of sending them to be handled on a separate thread. Message
s that are scheduled to be dispatched can be triggered by calling ShadowLooper.idleMainLooper()
.
- See Also:
ShadowLooper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowMessageQueue
ShadowMessageQueue.Picker
-
Constructor Summary
Constructors Constructor Description ShadowLegacyMessageQueue()
-
Method Summary
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.
-
Constructor Details
-
ShadowLegacyMessageQueue
public ShadowLegacyMessageQueue()
-
-
Method Details
-
nativeInit
-
nativeDestroy
-
nativeDestroy
-
nativeIsIdling
-
nativeIsIdling
-
getScheduler
Description copied from class:ShadowMessageQueue
Return this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
getScheduler
in classShadowMessageQueue
-
setScheduler
Description copied from class:ShadowMessageQueue
Set this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
setScheduler
in classShadowMessageQueue
-
getHead
Description copied from class:ShadowMessageQueue
Retrieves the current Message at the top of the queue.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
getHead
in classShadowMessageQueue
-
setHead
Description copied from class:ShadowMessageQueue
Sets the current Message at the top of the queue.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
setHead
in classShadowMessageQueue
-
reset
public void reset()Description copied from class:ShadowMessageQueue
Reset the messageQueue state. Should not be called by tests - it intended for use by the Robolectric framework.- Specified by:
reset
in classShadowMessageQueue
-
enqueueMessage
-
removeSyncBarrier
-