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

Commit d6113b0e authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Revert "Fix sleep during launch animation resulting in a unlocked device."

This reverts commit 7172089c.

Reason for revert: Found a better fix

Change-Id: I434ac735d2330788aafe9eec392605a66f6274ae
parent 7172089c
Loading
Loading
Loading
Loading
+10 −36
Original line number Original line Diff line number Diff line
@@ -1667,16 +1667,11 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
            return;
            return;
        }
        }


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

            setShowingLocked(true);
            // 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 */);

            mKeyguardViewControllerLazy.get().show(options);
            mKeyguardViewControllerLazy.get().show(options);
            resetKeyguardDonePendingLocked();
            resetKeyguardDonePendingLocked();
            mHideAnimationRun = false;
            mHideAnimationRun = false;
@@ -2368,29 +2356,15 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
                            @Override
                            @Override
                            public void onAnimationFinished() throws RemoteException {
                            public void onAnimationFinished() throws RemoteException {
                                try {
                                try {
                                    // WindowManager always needs to know that this animation
                                    // finished so it does not wait the 10s until timeout.
                                    finishedCallback.onAnimationFinished();
                                    finishedCallback.onAnimationFinished();
                                } catch (RemoteException e) {
                                } catch (RemoteException e) {
                                    Slog.w(TAG, "Failed to call onAnimationFinished", 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();
                                onKeyguardExitFinished();
                                mKeyguardViewControllerLazy.get().hide(0 /* startTime */,
                                mKeyguardViewControllerLazy.get().hide(0 /* startTime */,
                                        0 /* fadeoutDuration */);
                                        0 /* fadeoutDuration */);
                                mInteractionJankMonitor.end(CUJ_LOCKSCREEN_UNLOCK_ANIMATION);
                                mInteractionJankMonitor.end(CUJ_LOCKSCREEN_UNLOCK_ANIMATION);
                            }
                            }
                            }


                            @Override
                            @Override
                            public IBinder asBinder() {
                            public IBinder asBinder() {