Class ShadowMessage

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ShadowMessage.Picker
      The shadow Picker for this class
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowMessage()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract android.os.Message getNext()
      Convenience method to provide getter access to the private field Message.next.
      abstract void recycleUnchecked()
      Exposes the package-private Message.recycleUnchecked()
      static void reset()
      Resets the static state of the Message class by emptying the message pool.
      abstract void setNext​(android.os.Message next)
      Convenience method to provide setter access to the private field Message.next.
      abstract void setScheduledRunnable​(java.lang.Runnable r)
      Stores the Runnable instance that has been scheduled to invoke this message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowMessage

        public ShadowMessage()
    • Method Detail

      • recycleUnchecked

        public abstract void recycleUnchecked()
        Exposes the package-private Message.recycleUnchecked()
      • setScheduledRunnable

        public abstract void setScheduledRunnable​(java.lang.Runnable r)
        Stores the Runnable instance that has been scheduled to invoke this message. This is called when the message is enqueued by ShadowLegacyMessageQueue.enqueueMessage(android.os.Message, long) and is used when the message is recycled to ensure that the correct Runnable instance is removed from the associated scheduler.
        Parameters:
        r - the Runnable instance that is scheduled to trigger this message.

        #if ($api >= 21) * @see #recycleUnchecked() #else * @see #recycle() #end

        Only supported in LooperMode.Mode.LEGACY.

      • getNext

        public abstract android.os.Message getNext()
        Convenience method to provide getter access to the private field Message.next.

        Only supported in LooperMode.Mode.LEGACY

        Returns:
        The next message in the current message chain.
        See Also:
        setNext(Message)
      • setNext

        public abstract void setNext​(android.os.Message next)
        Convenience method to provide setter access to the private field Message.next.

        Only supported in LooperMode.Mode.LEGACY

        Parameters:
        next - the new next message for the current message.
        See Also:
        getNext()
      • reset

        @Resetter
        public static void reset()
        Resets the static state of the Message class by emptying the message pool.