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

Commit 0f635779 authored by Josh Tsuji's avatar Josh Tsuji Committed by Android (Google) Code Review
Browse files

Merge "Revert "Fix sleep during launch animation resulting in a unlocked device."" into tm-dev

parents e311f602 d6113b0e
Loading
Loading
Loading
Loading
+10 −36
Original line number Diff line number Diff line
@@ -1669,16 +1669,11 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
            return;
        }

        // If the keyguard is already showing, don't bother unless it was in the process of going
        // away. If it was going away, keyguard state may be out of sync and we should make sure to
        // re-show it explicitly. Check flags in both files to account for the hiding animation
        // which results in a delay and discrepancy between flags.
        if ((mShowing && mKeyguardViewControllerLazy.get().isShowing())
                && !mKeyguardStateController.isKeyguardGoingAway()) {
            if (DEBUG) {
                Log.d(TAG, "doKeyguard: not showing "
                        + "because it is already showing and not going away");
            }
        // if the keyguard is already showing, don't bother. check flags in both files
        // to account for the hiding animation which results in a delay and discrepancy
        // between flags
        if (mShowing && mKeyguardViewControllerLazy.get().isShowing()) {
            if (DEBUG) Log.d(TAG, "doKeyguard: not showing because it is already showing");
            resetStateLocked();
            return;
        }
@@ -2185,14 +2180,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
            mKeyguardExitAnimationRunner = null;
            mScreenOnCoordinator.setWakeAndUnlocking(false);
            mPendingLock = false;

            // If we're asked to re-show while the keyguard is going away, force callbacks to ensure
            // that state is re-set correctly. Otherwise, we might short circuit since mShowing is
            // true during the keyguard going away process, despite having partially set some state
            // to unlocked.
            setShowingLocked(
                    true, mKeyguardStateController.isKeyguardGoingAway() /* forceCallbacks */);

            setShowingLocked(true);
            mKeyguardViewControllerLazy.get().show(options);
            resetKeyguardDonePendingLocked();
            mHideAnimationRun = false;
@@ -2362,29 +2350,15 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
                            @Override
                            public void onAnimationFinished() throws RemoteException {
                                try {
                                    // WindowManager always needs to know that this animation
                                    // finished so it does not wait the 10s until timeout.
                                    finishedCallback.onAnimationFinished();
                                } catch (RemoteException e) {
                                    Slog.w(TAG, "Failed to call onAnimationFinished", e);
                                }

                                // If we're not interactive, it means the device is going back to
                                // sleep. This happens if the power button is pressed during the
                                // activity launch. If we're going back to sleep, we should *not*
                                // run keyguard exit finished callbacks and hide the keyguard, since
                                // we are in the process of locking again and this might result in
                                // the device staying unlocked when it shouldn't.
                                // We need to directly query isInteractive rather than mGoingToSleep
                                // because mGoingToSleep is set in onStartedGoingToSleep, which is
                                // dispatched asynchronously.
                                if (mPM.isInteractive()) {
                                onKeyguardExitFinished();
                                mKeyguardViewControllerLazy.get().hide(0 /* startTime */,
                                        0 /* fadeoutDuration */);
                                mInteractionJankMonitor.end(CUJ_LOCKSCREEN_UNLOCK_ANIMATION);
                            }
                            }

                            @Override
                            public IBinder asBinder() {