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

Commit 61676aa7 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Fix RemoteInput from dozing

Launching remote input from doze was broken because:
- We reset the keyguard, calling showKeyguard and clearing the states when stopping to doze
- updateIsKeyguard cleared the state; instead clear it now when we actually show / hide the keyguard

Change-Id: I901908d96ba93a49e4104b622bdd5ca604a8e392
Fixes: 64335172
Test: Receive message on AOD2, click Reply, verify it opens reply box
parent 6d5ebb7b
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -3779,6 +3779,7 @@ public class StatusBar extends SystemUI implements DemoMode,
            boolean afterKeyguardGone) {
        if (mWakefulnessLifecycle.getWakefulness() == WAKEFULNESS_ASLEEP
                && mUnlockMethodCache.canSkipBouncer()
                && !mLeaveOpenOnKeyguardHide
                && isPulsing()) {
            // Reuse the fingerprint wake-and-unlock transition if we dismiss keyguard from a pulse.
            // TODO: Factor this transition out of FingerprintUnlockController.
@@ -4221,6 +4222,8 @@ public class StatusBar extends SystemUI implements DemoMode,

    public void showKeyguard() {
        mKeyguardRequested = true;
        mLeaveOpenOnKeyguardHide = false;
        mPendingRemoteInputView = null;
        updateIsKeyguard();
        mAssistManager.onLockscreenShown();
    }
@@ -4271,13 +4274,11 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
        updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
        updatePanelExpansionForKeyguard();
        mLeaveOpenOnKeyguardHide = false;
        if (mDraggedDownRow != null) {
            mDraggedDownRow.setUserLocked(false);
            mDraggedDownRow.notifyHeightChanged(false  /* needsAnimation */);
            mDraggedDownRow = null;
        }
        mPendingRemoteInputView = null;
    }

    private void updatePanelExpansionForKeyguard() {
@@ -4417,15 +4418,19 @@ public class StatusBar extends SystemUI implements DemoMode,
        setBarState(StatusBarState.SHADE);
        View viewToClick = null;
        if (mLeaveOpenOnKeyguardHide) {
            if (!mKeyguardRequested) {
                mLeaveOpenOnKeyguardHide = false;
            }
            long delay = calculateGoingToFullShadeDelay();
            mNotificationPanel.animateToFullShade(delay);
            if (mDraggedDownRow != null) {
                mDraggedDownRow.setUserLocked(false);
                mDraggedDownRow = null;
            }
            if (!mKeyguardRequested) {
                viewToClick = mPendingRemoteInputView;
                mPendingRemoteInputView = null;
            }

            // Disable layout transitions in navbar for this transition because the load is just
            // too heavy for the CPU and GPU on any device.
+4 −2
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     */
    protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing) {
        if (mBouncer.needsFullscreenBouncer() && !mDozing) {

            // The keyguard might be showing (already). So we need to hide it.
            mStatusBar.hideKeyguard();
            mBouncer.show(true /* resetSecuritySelection */);
@@ -167,6 +166,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                mBouncer.prepare();
            }
        }
        updateStates();
    }

    private void showBouncer() {
@@ -250,7 +250,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void setDozing(boolean dozing) {
        if (mDozing != dozing) {
            mDozing = dozing;
            if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) {
                reset(dozing /* hideBouncerWhenShowing */);
            }
            updateStates();
        }
    }