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

Commit 195aad55 authored by Jiaming Liu's avatar Jiaming Liu Committed by Andrii Kulian
Browse files

Fix CTS test on devices not supporting concurrent display

In onSupportedStatesChanged and
updateRearDisplayPresentationStatusListeners, it tries to get the rear
display metrics, which will crash on devices without the mode.

Bug: 251747141
Test: atest ExtensionWindowLayoutComponentTest
Change-Id: I8698e62fdb414f798b9268d568119e9be2712f72
parent d159371d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -429,6 +429,9 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,

    @GuardedBy("mLock")
    private void updateRearDisplayStatusListeners(@WindowAreaStatus int windowAreaStatus) {
        if (mRearDisplayState == INVALID_DEVICE_STATE) {
            return;
        }
        synchronized (mLock) {
            for (int i = 0; i < mRearDisplayStatusListeners.size(); i++) {
                mRearDisplayStatusListeners.valueAt(i).accept(windowAreaStatus);
@@ -454,6 +457,9 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
    @GuardedBy("mLock")
    private void updateRearDisplayPresentationStatusListeners(
            @WindowAreaStatus int windowAreaStatus) {
        if (mConcurrentDisplayState == INVALID_DEVICE_STATE) {
            return;
        }
        RearDisplayPresentationStatus consumerValue = new RearDisplayPresentationStatus(
                windowAreaStatus, getRearDisplayMetrics());
        synchronized (mLock) {