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

Commit 91893471 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #7966357: Super lights out mode vs. volume dialog"

parents 53897ade 891d3fbb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
        lp.type = LayoutParams.TYPE_VOLUME_OVERLAY;
        lp.width = LayoutParams.WRAP_CONTENT;
        lp.height = LayoutParams.WRAP_CONTENT;
        lp.privateFlags |= LayoutParams.PRIVATE_FLAG_FORCE_SHOW_NAV_BAR;
        window.setAttributes(lp);
        window.addFlags(LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_NOT_TOUCH_MODAL
                | LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
+7 −0
Original line number Diff line number Diff line
@@ -945,6 +945,13 @@ public interface WindowManager extends ViewManager {
         * {@hide} */
        public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;

        /**
         * Special flag for the volume overlay: force the window manager out of "hide nav bar"
         * mode while the window is on screen.
         *
         * {@hide} */
        public static final int PRIVATE_FLAG_FORCE_SHOW_NAV_BAR = 0x00000020;

        /**
         * Control flags that are private to the platform.
         * @hide
+21 −1
Original line number Diff line number Diff line
@@ -412,6 +412,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    boolean mForceStatusBar;
    boolean mForceStatusBarFromKeyguard;
    boolean mHideLockScreen;
    boolean mForcingShowNavBar;
    int mForcingShowNavBarLayer;

    // States of keyguard dismiss.
    private static final int DISMISS_KEYGUARD_NONE = 0; // Keyguard not being dismissed.
@@ -2952,6 +2954,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mTopFullscreenOpaqueWindowState = null;
        mForceStatusBar = false;
        mForceStatusBarFromKeyguard = false;
        mForcingShowNavBar = false;
        mForcingShowNavBarLayer = -1;
        
        mHideLockScreen = false;
        mAllowLockscreenWhenOn = false;
@@ -2966,6 +2970,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                                WindowManager.LayoutParams attrs) {
        if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
                + win.isVisibleOrBehindKeyguardLw());
        if (mTopFullscreenOpaqueWindowState == null && (win.getAttrs().privateFlags
                &WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_SHOW_NAV_BAR) != 0) {
            if (mForcingShowNavBarLayer < 0) {
                mForcingShowNavBar = true;
                mForcingShowNavBarLayer = win.getSurfaceLayer();
            }
        }
        if (mTopFullscreenOpaqueWindowState == null &&
                win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw()) {
            if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
@@ -4494,9 +4505,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // will quickly lose focus once it correctly gets hidden.
            return 0;
        }
        final int visibility = mFocusedWindow.getSystemUiVisibility()
        int tmpVisibility = mFocusedWindow.getSystemUiVisibility()
                & ~mResettingSystemUiFlags
                & ~mForceClearedSystemUiFlags;
        if (mForcingShowNavBar && mFocusedWindow.getSurfaceLayer() < mForcingShowNavBarLayer) {
            tmpVisibility &= ~View.SYSTEM_UI_CLEARABLE_FLAGS;
        }
        final int visibility = tmpVisibility;
        int diff = visibility ^ mLastSystemUiFlags;
        final boolean needsMenu = mFocusedWindow.getNeedsMenuLw(mTopFullscreenOpaqueWindowState);
        if (diff == 0 && mLastFocusNeedsMenu == needsMenu
@@ -4692,6 +4707,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            pw.print(prefix); pw.print("mTopFullscreenOpaqueWindowState=");
                    pw.println(mTopFullscreenOpaqueWindowState);
        }
        if (mForcingShowNavBar) {
            pw.print(prefix); pw.print("mForcingShowNavBar=");
                    pw.println(mForcingShowNavBar); pw.print( "mForcingShowNavBarLayer=");
                    pw.println(mForcingShowNavBarLayer);
        }
        pw.print(prefix); pw.print("mTopIsFullscreen="); pw.print(mTopIsFullscreen);
                pw.print(" mHideLockScreen="); pw.println(mHideLockScreen);
        pw.print(prefix); pw.print("mForceStatusBar="); pw.print(mForceStatusBar);