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 shadowMessageQueue
forLooperMode.Mode.LEGACY
.In
LooperMode.Mode.LEGACY
Robolectric putsMessage
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 callingShadowLooper.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
All Methods Static Methods Instance Methods Concrete Methods 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.
-
-
-
Method Detail
-
nativeInit
@HiddenApi @Implementation public static Number nativeInit()
-
nativeDestroy
@HiddenApi @Implementation(minSdk=18, maxSdk=20) public static void nativeDestroy(int ptr)
-
nativeDestroy
@Implementation(minSdk=21) protected static void nativeDestroy(long ptr)
-
nativeIsIdling
@HiddenApi @Implementation(minSdk=19, maxSdk=20) public static boolean nativeIsIdling(int ptr)
-
nativeIsIdling
@Implementation(minSdk=21, maxSdk=22) protected static boolean nativeIsIdling(long ptr)
-
getScheduler
public Scheduler getScheduler()
Description copied from class:ShadowMessageQueue
Return this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
getScheduler
in classShadowMessageQueue
-
setScheduler
public void setScheduler(Scheduler scheduler)
Description copied from class:ShadowMessageQueue
Set this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
.- Specified by:
setScheduler
in classShadowMessageQueue
-
getHead
public Message 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
public void setHead(Message msg)
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
@Implementation protected boolean enqueueMessage(Message msg, long when)
-
removeSyncBarrier
@Implementation @HiddenApi protected void removeSyncBarrier(int token)
-
-