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

Commit a7e006da authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

Fix display events emitted when override info changed

After the split of display changed events into basic changes and refresh
rate changes, we have continued to emit both these events when
non-overridden display info is checked. This is incorrect as it is
possible for displays's basic information to change but refresh rate
still remains the same.

Bug: 397020451
Flag: EXEMPT trivial change
Test: Manually run abtd to validate the metrics
Change-Id: I14c031acb3fac4ac38d75c1cccfd2884bfbef005
parent 7fd1b808
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -890,10 +890,12 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
                // still need to let WindowManager know so it can update its own internal state for
                // things like display cutouts.
                display.getNonOverrideDisplayInfoLocked(mTempDisplayInfo);
                if (!mTempNonOverrideDisplayInfo.equals(mTempDisplayInfo)) {
                    logicalDisplayEventMask |= LOGICAL_DISPLAY_EVENT_BASIC_CHANGED
                            | LOGICAL_DISPLAY_EVENT_REFRESH_RATE_CHANGED;
                if (!mTempNonOverrideDisplayInfo.equals(mTempDisplayInfo,
                        /* compareOnlyBasicChanges */ true)) {
                    logicalDisplayEventMask |= LOGICAL_DISPLAY_EVENT_BASIC_CHANGED;
                }
                logicalDisplayEventMask
                        |= updateAndGetMaskForDisplayPropertyChanges(mTempNonOverrideDisplayInfo);
            }
            mLogicalDisplaysToUpdate.put(displayId, logicalDisplayEventMask);
            mUpdatedLogicalDisplays.put(displayId, UPDATE_STATE_UPDATED);
+1 −2
Original line number Diff line number Diff line
@@ -984,8 +984,7 @@ public class DisplayManagerServiceTest {

        Handler handler = displayManager.getDisplayHandler();
        waitForIdleHandler(handler);
        assertThat(callback.receivedEvents()).containsExactly(EVENT_DISPLAY_BASIC_CHANGED,
                EVENT_DISPLAY_REFRESH_RATE_CHANGED);
        assertThat(callback.receivedEvents()).containsExactly(EVENT_DISPLAY_BASIC_CHANGED);
    }

    /**