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

Commit a3f4bf53 authored by Craig Mautner's avatar Craig Mautner
Browse files

Always layout Keyguard on config change.

Add Keyguard to list of windows that can't be hidden by keyguard.

Don't assign Configuration to window until layout has had a chance
to compare it to window's existing Configuration.

Bug: 7094175
Change-Id: I99a9fd4af9a31871fe130db7b6bdf49bd51a6092
parent 33387b1b
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -1473,16 +1473,24 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation);
    }

    @Override
    public boolean doesForceHide(WindowState win, WindowManager.LayoutParams attrs) {
        return attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD;
    }

    @Override
    public boolean canBeForceHidden(WindowState win, WindowManager.LayoutParams attrs) {
        return attrs.type != WindowManager.LayoutParams.TYPE_STATUS_BAR
                && attrs.type != WindowManager.LayoutParams.TYPE_NAVIGATION_BAR
                && attrs.type != WindowManager.LayoutParams.TYPE_WALLPAPER
                && attrs.type != WindowManager.LayoutParams.TYPE_DREAM
                && attrs.type != WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND;
        switch (attrs.type) {
            case TYPE_STATUS_BAR:
            case TYPE_NAVIGATION_BAR:
            case TYPE_WALLPAPER:
            case TYPE_DREAM:
            case TYPE_UNIVERSE_BACKGROUND:
            case TYPE_KEYGUARD:
                return false;
            default:
                return true;
        }
    }

    /** {@inheritDoc} */
+5 −12
Original line number Diff line number Diff line
@@ -2823,16 +2823,9 @@ public class WindowManagerService extends IWindowManager.Stub
                                "Relayout window turning screen on: " + win);
                        win.mTurnOnScreen = true;
                    }
                    int diff = 0;
                    if (win.mConfiguration != mCurConfiguration
                            && (win.mConfiguration == null
                                    || (diff=mCurConfiguration.diff(win.mConfiguration)) != 0)) {
                        win.mConfiguration = mCurConfiguration;
                        if (DEBUG_CONFIGURATION) {
                            Slog.i(TAG, "Window " + win + " visible with new config: "
                                    + win.mConfiguration + " / 0x"
                                    + Integer.toHexString(diff));
                        }
                    if (win.isConfigChanged()) {
                        if (DEBUG_CONFIGURATION) Slog.i(TAG, "Window " + win
                                + " visible with new config: " + win.mConfiguration);
                        outConfig.setTo(mCurConfiguration);
                    }
                }
@@ -8260,7 +8253,7 @@ public class WindowManagerService extends IWindowManager.Stub
                Slog.v(TAG, "1ST PASS " + win
                        + ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame
                        + " mLayoutAttached=" + win.mLayoutAttached
                        + " screen changed=" + win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE));
                        + " screen changed=" + win.isConfigChanged());
                final AppWindowToken atoken = win.mAppToken;
                if (gone) Slog.v(TAG, "  GONE: mViewVisibility="
                        + win.mViewVisibility + " mRelayoutCalled="
@@ -8282,7 +8275,7 @@ public class WindowManagerService extends IWindowManager.Stub
            // windows, since that means "perform layout as normal,
            // just don't display").
            if (!gone || !win.mHaveFrame || win.mLayoutNeeded
                    || win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE)
                    || win.isConfigChanged()
                    || win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
                if (!win.mLayoutAttached) {
                    if (initial) {