Continue receiving key events from input consumer after settling into Overview
This builds on ag/13732971. In live tile mode after settling into overview, recents_animation_input_consumer should have the focus, and thus we will need to extend the lifecycle of input consumers so that key events can be routed to launcher Overall, since live tile extends the lifecycle of certain private variables of AbsSwipeHandler, I am thinking of doing a refactor by putting those things into a separate class, but it might be too big for this change. TODO: I've verified that this change works while if we don't process motion events, it would cause b/182932863. Will investigate on that. Fixes: 181404912 Test: Cherry pick ag/13732971; Go to overview; Swipe back; Observe the animation to go back to app Change-Id: I5afd397be387b75f373442781dd1d00560dca99e
This commit is contained in:
1 parent
e3ae7e3afa
commit
b0b2a9acd0
2 files changed
+16
-1
No files matched your search
@@ -1334,7 +1334,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
}
|
||||
|
||||
private void invalidateHandler() {
|
||||
mInputConsumerProxy.destroy();
|
||||
if (!LIVE_TILE.get() || !mActivityInterface.isInLiveTileMode()
|
||||
|| mGestureState.getEndTarget() != RECENTS) {
|
||||
mInputConsumerProxy.destroy();
|
||||
mTaskAnimationManager.setLiveTileCleanUpHandler(null);
|
||||
}
|
||||
endRunningWindowAnim(false /* cancel */);
|
||||
|
||||
if (mGestureEndCallback != null) {
|
||||
@@ -1526,6 +1530,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
apps[apps.length - 1] = appearedTaskTarget;
|
||||
launchOtherTaskInLiveTileMode(appearedTaskTarget.taskId, apps);
|
||||
});
|
||||
mTaskAnimationManager.setLiveTileCleanUpHandler(mInputConsumerProxy::destroy);
|
||||
ActivityManagerWrapper.getInstance().registerTaskStackListener(
|
||||
mLiveTileRestartListener);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
|
||||
private GestureState mLastGestureState;
|
||||
private RemoteAnimationTargetCompat mLastAppearedTaskTarget;
|
||||
private Consumer<RemoteAnimationTargetCompat> mLaunchOtherTaskHandler;
|
||||
private Runnable mLiveTileCleanUpHandler;
|
||||
private Context mCtx;
|
||||
|
||||
TaskAnimationManager(Context ctx) {
|
||||
@@ -169,6 +170,10 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
|
||||
mLaunchOtherTaskHandler = handler;
|
||||
}
|
||||
|
||||
public void setLiveTileCleanUpHandler(Runnable runnable) {
|
||||
mLiveTileCleanUpHandler = runnable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finishes the running recents animation.
|
||||
*/
|
||||
@@ -206,6 +211,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
|
||||
* Cleans up the recents animation entirely.
|
||||
*/
|
||||
private void cleanUpRecentsAnimation() {
|
||||
if (mLiveTileCleanUpHandler != null) {
|
||||
mLiveTileCleanUpHandler.run();
|
||||
mLiveTileCleanUpHandler = null;
|
||||
}
|
||||
|
||||
// Release all the target leashes
|
||||
if (mTargets != null) {
|
||||
mTargets.release();
|
||||
|
||||
Reference in new issue
Block a user