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

Commit 9872e0f7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Call KeyguardViewMediator#hideWithAnimation on the main thread" into sc-dev am: 0d0d1ae6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881283

Change-Id: I175f262540d32697d79b3a8672cbd2692a631457
parents 4cb84800 0d0d1ae6
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1651,14 +1651,19 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
        Trace.endSection();
    }

    /** Hide the keyguard and let {@code runner} handle the animation. */
    /**
     * Hide the keyguard and let {@code runner} handle the animation.
     *
     * This method should typically be called after {@link ViewMediatorCallback#keyguardDonePending}
     * was called, when we are ready to hide the keyguard.
     */
    public void hideWithAnimation(IRemoteAnimationRunner runner) {
        if (!mShowing) {
        if (!mKeyguardDonePending) {
            return;
        }

        mKeyguardExitAnimationRunner = runner;
        hideLocked();
        mViewMediatorCallback.readyForKeyguardDone();
    }

    /**
+6 −1
Original line number Diff line number Diff line
@@ -2118,7 +2118,12 @@ public class StatusBar extends SystemUI implements DemoMode,
            return;
        }

        mKeyguardViewMediator.hideWithAnimation(runner);
        // We post to the main thread for 2 reasons:
        //   1. KeyguardViewMediator is not thread-safe.
        //   2. To ensure that ViewMediatorCallback#keyguardDonePending is called before
        //      ViewMediatorCallback#readyForKeyguardDone. The wrong order could occur when doing
        //      dismissKeyguardThenExecute { hideKeyguardWithAnimation(runner) }.
        mMainThreadHandler.post(() -> mKeyguardViewMediator.hideWithAnimation(runner));
    }

    @Override