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

Commit 7998e48c authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix unlock transition when docked stack is visible

- Keep surface of docked divider when lockscreen is showing, like
all other apps, so we don't run into synchronization issues when
unlocking. We do this by setting policy visibily to false, but
keep clientVisibility=true
- Update docked stack visibility when starting unlock sequence to
visible.

Bug: 27154882
Change-Id: I6def5c18831e23579fcfc904133749f149eaf376
parent 4c5bd240
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6430,6 +6430,9 @@ public final class ActivityManagerService extends ActivityManagerNative
                if (mLockScreenShown == LOCK_SCREEN_SHOWN) {
                    mLockScreenShown = LOCK_SCREEN_HIDDEN;
                    updateSleepIfNeededLocked();
                    // Some stack visibility might change (e.g. docked stack)
                    mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
                }
            }
        } finally {
+0 −1
Original line number Diff line number Diff line
@@ -2409,7 +2409,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case TYPE_WALLPAPER:
            case TYPE_DREAM:
            case TYPE_KEYGUARD_SCRIM:
            case TYPE_DOCK_DIVIDER:
                return false;
            default:
                // Hide only windows below the keyguard host window.
+3 −1
Original line number Diff line number Diff line
@@ -102,7 +102,9 @@ public class DockedStackDividerController implements DimLayerUser {
            return;
        }
        TaskStack stack = mDisplayContent.mService.mStackIdToStack.get(DOCKED_STACK_ID);
        final boolean visible = stack != null && stack.isVisibleLocked();

        // If the stack is invisible, we policy force hide it in WindowAnimator.shouldForceHide
        final boolean visible = stack != null;
        if (mLastVisibility == visible && !force) {
            return;
        }
+2 −1
Original line number Diff line number Diff line
@@ -898,7 +898,8 @@ public class TaskStack implements DimLayer.DimLayerUser,
    }

    boolean isVisibleLocked() {
        final boolean keyguardOn = mService.mPolicy.isKeyguardShowingOrOccluded();
        final boolean keyguardOn = mService.mPolicy.isKeyguardShowingOrOccluded()
                && !mService.mAnimator.mKeyguardGoingAway;
        if (keyguardOn && !StackId.isAllowedOverLockscreen(mStackId)) {
            // The keyguard is showing and the stack shouldn't show on top of the keyguard.
            return false;
+5 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEYGUARD;
@@ -231,7 +232,10 @@ public class WindowAnimator {
        // Only hide windows if the keyguard is active and not animating away.
        boolean keyguardOn = mPolicy.isKeyguardShowingOrOccluded()
                && mForceHiding != KEYGUARD_ANIMATING_OUT;
        return keyguardOn && !allowWhenLocked && (win.getDisplayId() == Display.DEFAULT_DISPLAY);
        boolean hideDockDivider = win.mAttrs.type == TYPE_DOCK_DIVIDER
                && win.getDisplayContent().getDockedStackLocked() == null;
        return keyguardOn && !allowWhenLocked && (win.getDisplayId() == Display.DEFAULT_DISPLAY)
                || hideDockDivider;
    }

    private void updateWindowsLocked(final int displayId) {