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

Commit 4932fee9 authored by Jiaming Liu's avatar Jiaming Liu
Browse files

Determine rear display status only based on device states

onRequestCanceled callback came before device state callback, which caused updateRearDisplayStatusListeners in line 553 to call back with STATUS_ACTIVE after the cancelation callback. onRequestActivated and onRequestCanceled don't need to update rear display status listeners, because there are always device state callbacks that will trigger updateRearDisplayStatusListeners.

Bug: 264962409
Test: atest ExtensionRearDisplayTest
Change-Id: Ibaf8ecfa3da8544a4a07ee803989fa136200c350
parent 8df6d94c
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -414,8 +414,7 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
            return WindowAreaComponent.STATUS_UNAVAILABLE;
            return WindowAreaComponent.STATUS_UNAVAILABLE;
        }
        }


        if (mRearDisplaySessionStatus == WindowAreaComponent.SESSION_STATE_ACTIVE
        if (isRearDisplayActive()) {
                || isRearDisplayActive()) {
            return WindowAreaComponent.STATUS_ACTIVE;
            return WindowAreaComponent.STATUS_ACTIVE;
        }
        }


@@ -537,7 +536,6 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
                if (request.equals(mRearDisplayStateRequest)) {
                if (request.equals(mRearDisplayStateRequest)) {
                    mRearDisplaySessionStatus = WindowAreaComponent.SESSION_STATE_ACTIVE;
                    mRearDisplaySessionStatus = WindowAreaComponent.SESSION_STATE_ACTIVE;
                    mRearDisplaySessionCallback.accept(mRearDisplaySessionStatus);
                    mRearDisplaySessionCallback.accept(mRearDisplaySessionStatus);
                    updateRearDisplayStatusListeners(getCurrentRearDisplayModeStatus());
                }
                }
            }
            }
        }
        }
@@ -550,7 +548,6 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
                }
                }
                mRearDisplaySessionStatus = WindowAreaComponent.SESSION_STATE_INACTIVE;
                mRearDisplaySessionStatus = WindowAreaComponent.SESSION_STATE_INACTIVE;
                mRearDisplaySessionCallback.accept(mRearDisplaySessionStatus);
                mRearDisplaySessionCallback.accept(mRearDisplaySessionStatus);
                updateRearDisplayStatusListeners(getCurrentRearDisplayModeStatus());
            }
            }
        }
        }
    }
    }