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

Commit 453033f6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use different reorder modes for fail safe before and after Overview"

parents 6a2f935e 9e0354f6
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;
            }
        }
    };

    /**