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

Commit 5733105a authored by wilsonshih's avatar wilsonshih
Browse files

Do not start RecentsMixedTransition if keyguard transition is playing

If the keyguard transition animation is playing before/during start
recents transition, there should not start recents mixed transition
because recents won't receive keyguard transition, which would cause
recents get stucked.
Also just fallback to normal recents transition if the keyguard state
was changed when RecentsMixedTransition receive transition ready.

Flag: EXEMPT bugfix
Bug: 378002568
Test: try to simulate by launch app from keyguard-shortcut, unlock
keyguard with face unlock, and trigger recents at the same time.

Change-Id: I28d6fbfdf5f47548ceb7ffdcc47b57866a8e14a5
parent 6d657891
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -173,6 +173,10 @@ public class KeyguardTransitionHandler
        return mKeyguardShowing;
        return mKeyguardShowing;
    }
    }


    public boolean isKeyguardAnimating() {
        return !mStartedTransitions.isEmpty();
    }

    @Override
    @Override
    public void onTaskMovedToFront(ActivityManager.RunningTaskInfo taskInfo) {
    public void onTaskMovedToFront(ActivityManager.RunningTaskInfo taskInfo) {
        mDreamToken = taskInfo.getActivityType() == ACTIVITY_TYPE_DREAM ? taskInfo.token : null;
        mDreamToken = taskInfo.getActivityType() == ACTIVITY_TYPE_DREAM ? taskInfo.token : null;
+2 −1
Original line number Original line Diff line number Diff line
@@ -370,7 +370,8 @@ public class DefaultMixedHandler implements MixedTransitionHandler,
        if (mRecentsHandler != null) {
        if (mRecentsHandler != null) {
            if (mSplitHandler.isSplitScreenVisible()) {
            if (mSplitHandler.isSplitScreenVisible()) {
                return this::setRecentsTransitionDuringSplit;
                return this::setRecentsTransitionDuringSplit;
            } else if (mKeyguardHandler.isKeyguardShowing()) {
            } else if (mKeyguardHandler.isKeyguardShowing()
                    && !mKeyguardHandler.isKeyguardAnimating()) {
                return this::setRecentsTransitionDuringKeyguard;
                return this::setRecentsTransitionDuringKeyguard;
            } else if (mDesktopTasksController != null
            } else if (mDesktopTasksController != null
                    // Check on the default display. Recents/gesture nav is only available there
                    // Check on the default display. Recents/gesture nav is only available there
+5 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,11 @@ class RecentsMixedTransition extends DefaultMixedHandler.MixedTransition {
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Mixed transition for Recents during"
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Mixed transition for Recents during"
                + " Keyguard #%d", info.getDebugId());
                + " Keyguard #%d", info.getDebugId());


        if (!mKeyguardHandler.isKeyguardShowing() || mKeyguardHandler.isKeyguardAnimating()) {
            ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Cancel mixed transition because "
                    + "keyguard state was changed #%d", info.getDebugId());
            return false;
        }
        if (mInfo == null) {
        if (mInfo == null) {
            mInfo = info;
            mInfo = info;
            mFinishT = finishTransaction;
            mFinishT = finishTransaction;