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

Commit ce73c1e5 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Framework change for #2583442: Navigation dies when night mode changes

The window manager doesn't retain its keep screen on lock while
in the process of destroying and creating new activity windows during
a config change.  Now it does.

Unfortunately, this doesn't help maps, since it doesn't use our
lovely KEEP_SCREEN_ON flag. :p

Change-Id: Ida4bc0fcfe132cdff2bd4eeb7ba0ce9731504d14
parent ae8c2c71
Loading
Loading
Loading
Loading
+27 −17
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ public class WindowManagerService extends IWindowManager.Stub
    static final boolean DEBUG_STARTING_WINDOW = false;
    static final boolean DEBUG_REORDER = false;
    static final boolean DEBUG_WALLPAPER = false;
    static final boolean DEBUG_FREEZE = false;
    static final boolean SHOW_TRANSACTIONS = false;
    static final boolean HIDE_STACK_CRAWLS = true;
    static final boolean MEASURE_LATENCY = false;
@@ -10695,6 +10696,10 @@ public class WindowManagerService extends IWindowManager.Stub
        } else if (animating) {
            requestAnimationLocked(currentTime+(1000/60)-SystemClock.uptimeMillis());
        }
        
        if (DEBUG_FREEZE) Slog.v(TAG, "Layout: mDisplayFrozen=" + mDisplayFrozen
                + " holdScreen=" + holdScreen);
        if (!mDisplayFrozen) {
            mQueue.setHoldScreenLocked(holdScreen != null);
            if (screenBrightness < 0 || screenBrightness > 1.0f) {
                mPowerManager.setScreenBrightnessOverride(-1);
@@ -10713,6 +10718,7 @@ public class WindowManagerService extends IWindowManager.Stub
                Message m = mH.obtainMessage(H.HOLD_SCREEN_CHANGED, holdScreen);
                mH.sendMessage(m);
            }
        }

        if (mTurnOnScreen) {
            if (DEBUG_VISIBILITY) Slog.v(TAG, "Turning screen on after layout!");
@@ -10988,6 +10994,8 @@ public class WindowManagerService extends IWindowManager.Stub
            mFreezeGcPending = now;
        }

        if (DEBUG_FREEZE) Slog.v(TAG, "*** FREEZING DISPLAY", new RuntimeException());
        
        mDisplayFrozen = true;
        if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
            mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET;
@@ -11011,6 +11019,8 @@ public class WindowManagerService extends IWindowManager.Stub
            return;
        }
        
        if (DEBUG_FREEZE) Slog.v(TAG, "*** UNFREEZING DISPLAY", new RuntimeException());
        
        mDisplayFrozen = false;
        mH.removeMessages(H.APP_FREEZE_TIMEOUT);
        if (PROFILE_ORIENTATION) {