Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f9b393 authored by Manasi Navare's avatar Manasi Navare
Browse files

Consume the modeRejected event based on Event Registration flag value



The modeRejected event sent by Surfaceflinger was consumed by all
the listeners (Display Event Reciever and Chreographer) causing
a crash in Choregrapher for this event since dispatchModeRejected()
in Choreographer is not registered.

This patch adds a Event registration flag corresponding to the
mode rejected event and only the listeners where this flag
is set will recieve this modeRejected event sent by
SF. SO in this case only DER recieves this event.

Test: manual test
Bug: 409640463
Flag: EXEMPT bug fix

Change-Id: I7312baa6c21b2a9ddd160713af5873a5a6b90f7d
Signed-off-by: default avatarManasi Navare <navaremanasi@google.com>
parent b8e1cbaa
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -77,6 +77,13 @@ public abstract class DisplayEventReceiver {
     */
    public static final int EVENT_REGISTRATION_FRAME_RATE_OVERRIDE_FLAG = 0x2;

    /**
     * Specifies to generate mode rejected events from Surface Flinger.
     * <p>
     * Keep in sync with frameworks/native/libs/gui/aidl/android/gui/ISurfaceComposer.aidl
     */
    public static final int EVENT_REGISTRATION_MODE_REJECTED_FLAG = 0x4;

    private static final String TAG = "DisplayEventReceiver";

    @UnsupportedAppUsage
+2 −1
Original line number Diff line number Diff line
@@ -1628,7 +1628,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
        ProxyDisplayEventReceiver(Looper looper, DisplayEventListener listener) {
            super(looper, VSYNC_SOURCE_APP,
                    EVENT_REGISTRATION_MODE_CHANGED_FLAG
                            | EVENT_REGISTRATION_FRAME_RATE_OVERRIDE_FLAG);
                            | EVENT_REGISTRATION_FRAME_RATE_OVERRIDE_FLAG
                            | EVENT_REGISTRATION_MODE_REJECTED_FLAG);
            mListener = listener;
        }