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

Commit 9e0354f6 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Use different reorder modes for fail safe before and after Overview

Currently, when recents animation is cancelled from fail safe mechanism,
we put the previous app back to the top. It no longer makes sense when
live tile is in the picture since we don't want the user to see the
previous app being brought up when they turn off and on the phone.

Fixes: 142088072
Test: Turn off and screen and back on. Make sure the user goes back to
home instead of previous app in live tile mode.

Change-Id: I5f16c4c8c77b918dc706c45acadf143edc454de9
parent 4b523ff7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -120,4 +120,10 @@ interface IRecentsAnimationController {
     * @see IRecentsAnimationRunner#onCancelled
     */
    void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot);

    /**
     * Sets a state for controller to decide which surface is the destination when the recents
     * animation is cancelled through fail safe mechanism.
     */
    void setWillFinishToHome(boolean willFinishToHome);
}
+11 −0
Original line number Diff line number Diff line
@@ -115,4 +115,15 @@ public class RecentsAnimationControllerCompat {
            Log.e(TAG, "Failed to clean up screenshot of recents animation", e);
        }
    }

    /**
     * @see {{@link IRecentsAnimationController#setWillFinishToHome(boolean)}}.
     */
    public void setWillFinishToHome(boolean willFinishToHome) {
        try {
            mAnimationController.setWillFinishToHome(willFinishToHome);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to set overview reached state", e);
        }
    }
}
 No newline at end of file
+11 −2
Original line number Diff line number Diff line
@@ -98,8 +98,10 @@ public class RecentsAnimationController implements DeathRecipient {
    private final ArrayList<WallpaperAnimationAdapter> mPendingWallpaperAnimations =
            new ArrayList<>();
    private final int mDisplayId;
    private final Runnable mFailsafeRunnable = () ->
            cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION, "failSafeRunnable");
    private boolean mWillFinishToHome = false;
    private final Runnable mFailsafeRunnable = () -> cancelAnimation(
            mWillFinishToHome ? REORDER_MOVE_TO_TOP : REORDER_MOVE_TO_ORIGINAL_POSITION,
            "failSafeRunnable");

    // The recents component app token that is shown behind the visibile tasks
    private AppWindowToken mTargetAppToken;
@@ -326,6 +328,13 @@ public class RecentsAnimationController implements DeathRecipient {
                }
            }
        }

        @Override
        public void setWillFinishToHome(boolean willFinishToHome) {
            synchronized (mService.getWindowManagerLock()) {
                mWillFinishToHome = willFinishToHome;
            }
        }
    };

    /**