Class ShadowDisplayEventReceiver

java.lang.Object
org.robolectric.shadows.ShadowDisplayEventReceiver

@Implements(className="android.view.DisplayEventReceiver", isInAndroidSdk=false) public class ShadowDisplayEventReceiver extends Object
Shadow of DisplayEventReceiver. The Choreographer is a subclass of DisplayEventReceiver, and receives vsync events from the display indicating the frequency that frames should be generated.

The ShadowDisplayEventReceiver can run in either a paused mode or a non-paused mode, see ShadowChoreographer.isPaused() and ShadowChoreographer.setPaused(boolean). By default it runs unpaused, and each time a frame callback is scheduled with the Choreographer the clock is advanced to the next frame, configured by ShadowChoreographer.setFrameDelay(Duration). In paused mode the clock is not auto advanced and the next frame will only trigger when the clock is advance manually or via the ShadowLooper.

  • Field Details

  • Constructor Details

    • ShadowDisplayEventReceiver

      public ShadowDisplayEventReceiver()
  • Method Details

    • nativeInit

      @Implementation(minSdk=26, maxSdk=29) protected static long nativeInit(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue, int vsyncSource)
    • nativeInit

      @Implementation(minSdk=23, maxSdk=25) protected static long nativeInit(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue)
    • nativeInit

      @Implementation(minSdk=30, maxSdk=33) protected static long nativeInit(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue, int vsyncSource, int configChanged)
    • nativeInit

      @Implementation(minSdk=34) protected static long nativeInit(WeakReference<DisplayEventReceiver> receiver, WeakReference<Object> vsyncEventData, MessageQueue msgQueue, int vsyncSource, int eventRegistration, long layerHandle)
    • nativeDispose

      @Implementation(maxSdk=33) protected static void nativeDispose(long receiverPtr)
    • nativeScheduleVsync

      @Implementation protected static void nativeScheduleVsync(long receiverPtr)
    • nativeGetLatestVsyncEventData

      @Implementation(minSdk=33) protected static Object nativeGetLatestVsyncEventData(long receiverPtr)
    • dispose

      @Implementation(maxSdk=30) protected void dispose(boolean finalized)
    • onVsync

      protected void onVsync(long frameTimeNanos, int frame, Object vsyncEventData)