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

Commit ebeb70d9 authored by tiger_huang's avatar tiger_huang Committed by Steve Kondik
Browse files

Ensure the occlude state of keyguard is correct

If the keyguard is dismissed by an app with FLAG_DISMISS_KEYGUARD,
PhoneWindowManager would set keyguard to be occluded. After the user
changes to another app without FLAG_DISMISS_KEYGUARD, the occlude
state should be cleared, even keyguard is not showing.

https://code.google.com/p/android/issues/detail?id=178617

Change-Id: I84fc86ae5c95c122c98445b76495735adbdcaeba
parent a89ab17a
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -5293,23 +5293,25 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     */
    private boolean setKeyguardOccludedLw(boolean isOccluded) {
        boolean wasOccluded = mKeyguardOccluded;
        boolean showing = mKeyguardDelegate.isShowing();
        if (wasOccluded && !isOccluded && showing) {
        if (wasOccluded && !isOccluded) {
            mKeyguardOccluded = false;
            mKeyguardDelegate.setOccluded(false);
            if (mKeyguardDelegate.isShowing()) {
                mStatusBar.getAttrs().privateFlags |= PRIVATE_FLAG_KEYGUARD;
                mStatusBar.getAttrs().flags |= FLAG_SHOW_WALLPAPER;
                return true;
        } else if (!wasOccluded && isOccluded && showing) {
            }
        } else if (!wasOccluded && isOccluded) {
            mKeyguardOccluded = true;
            mKeyguardDelegate.setOccluded(true);
            if (mKeyguardDelegate.isShowing()) {
                mStatusBar.getAttrs().privateFlags &= ~PRIVATE_FLAG_KEYGUARD;
                mStatusBar.getAttrs().flags &= ~FLAG_SHOW_WALLPAPER;
                return true;
        } else {
            return false;
            }
        }
        return false;
    }

    private boolean isStatusBarKeyguard() {
        return mStatusBar != null