Package org.robolectric.shadows
Class ShadowDisplayEventReceiver
java.lang.Object
org.robolectric.shadows.ShadowDisplayEventReceiver
@Implements(className="android.view.DisplayEventReceiver",
isInAndroidSdk=false,
looseSignatures=true)
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
.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
Reflector interface forDisplayEventReceiver
's internals. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
dispose
(boolean finalized) protected Object
protected static void
nativeDispose
(long receiverPtr) protected static long
nativeInit
(DisplayEventReceiver receiver, MessageQueue msgQueue) protected static long
nativeInit
(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue) protected static long
nativeInit
(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue, int vsyncSource) protected static long
nativeInit
(WeakReference<DisplayEventReceiver> receiver, MessageQueue msgQueue, int vsyncSource, int configChanged) protected static long
nativeInit
(WeakReference<DisplayEventReceiver> receiver, WeakReference<Object> vsyncEventData, MessageQueue msgQueue, int vsyncSource, int eventRegistration, long layerHandle) protected static void
nativeScheduleVsync
(long receiverPtr) protected void
onVsync()
-
Field Details
-
realReceiver
-
-
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(maxSdk=22) protected static long nativeInit(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
-
nativeScheduleVsync
-
dispose
-
onVsync
protected void onVsync() -
getLatestVsyncEventData
-