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

Commit 042059d0 authored by chaviw's avatar chaviw
Browse files

Remove TURN_ON_SCREEN from bulkUpdate and set mTurnOnScreen.

If TURN_ON_SCREEN is added to the bulkUpdate flags, there's a
possibility it can get cleared before it's actually used. Instead,
just set the mService.mTurnOnScreen flag directly so it only gets
cleared when it's used.

Test: Windows with turnOnScreen flag work correctly now.
Test: ActivityManagerActivityVisibilityTests.testTurnScreenOnActivity
Test: go/wm-smoke
Fixes: 71789344

Change-Id: I7aba2bb8c7c960216df79b59b11e6efb552ed2cb
parent f2a48eb7
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ import static com.android.server.wm.WindowManagerService.H.WINDOW_FREEZE_TIMEOUT
import static com.android.server.wm.WindowManagerService.logSurface;
import static com.android.server.wm.WindowSurfacePlacer.SET_FORCE_HIDING_CHANGED;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowSurfacePlacer.SET_TURN_ON_SCREEN;
import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION;
import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_ACTION_PENDING;
import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_MAY_CHANGE;
@@ -968,9 +967,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
                doRequest = true;
            }
        }
        if ((bulkUpdateParams & SET_TURN_ON_SCREEN) != 0) {
            mService.mTurnOnScreen = true;
        }

        if ((bulkUpdateParams & SET_WALLPAPER_ACTION_PENDING) != 0) {
            mWallpaperActionPending = true;
        }
+0 −3
Original line number Diff line number Diff line
@@ -292,9 +292,6 @@ public class WindowAnimator {
        if ((bulkUpdateParams & WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE) != 0) {
            builder.append(" ORIENTATION_CHANGE_COMPLETE");
        }
        if ((bulkUpdateParams & WindowSurfacePlacer.SET_TURN_ON_SCREEN) != 0) {
            builder.append(" TURN_ON_SCREEN");
        }
        return builder.toString();
    }

+1 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
import static com.android.server.wm.WindowManagerService.logWithStack;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowSurfacePlacer.SET_TURN_ON_SCREEN;
import static com.android.server.wm.proto.WindowStateAnimatorProto.DRAW_STATE;
import static com.android.server.wm.proto.WindowStateAnimatorProto.LAST_CLIP_RECT;
import static com.android.server.wm.proto.WindowStateAnimatorProto.SURFACE;
@@ -1165,7 +1164,7 @@ class WindowStateAnimator {
                    // potentially occurring while turning off the screen. This would lead to the
                    // screen incorrectly turning back on.
                    if (!mService.mPowerManager.isInteractive()) {
                        mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
                        mService.mTurnOnScreen = true;
                    }
                }
            }
+1 −2
Original line number Diff line number Diff line
@@ -86,8 +86,7 @@ class WindowSurfacePlacer {
    static final int SET_WALLPAPER_MAY_CHANGE           = 1 << 1;
    static final int SET_FORCE_HIDING_CHANGED           = 1 << 2;
    static final int SET_ORIENTATION_CHANGE_COMPLETE    = 1 << 3;
    static final int SET_TURN_ON_SCREEN                 = 1 << 4;
    static final int SET_WALLPAPER_ACTION_PENDING       = 1 << 5;
    static final int SET_WALLPAPER_ACTION_PENDING       = 1 << 4;

    private boolean mTraversalScheduled;
    private int mDeferDepth = 0;