Temporary fix to disable task#onClickListener during transition to overview
The root cause is InputConsumerProxy not getting events during the transition. Will need to investigate more, but since we dont allow interaction with TaskView during the transition currently, apply this temporary fix to unblock
Bug: 175039524
Test: manual
Change-Id: Ifc3eb0569cf3a60d193e91bf70519a0737afb90a
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index d648dd6..13b7d8d 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -970,6 +970,9 @@
}
duration = Math.max(duration, mRecentsView.getScroller().getDuration());
}
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ mRecentsView.getRunningTaskView().setIsClickableAsLiveTile(false);
+ }
}
// Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
@@ -1447,6 +1450,7 @@
private void finishCurrentTransitionToRecents() {
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
+ mRecentsView.getRunningTaskView().setIsClickableAsLiveTile(true);
} else if (!hasTargets() || mRecentsAnimationController == null) {
// If there are no targets or the animation not started, then there is nothing to finish
mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index b791d29..e8f590f 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -257,6 +257,8 @@
private final float[] mIconCenterCoords = new float[2];
private final float[] mChipCenterCoords = new float[2];
+ private boolean mIsClickableAsLiveTile = true;
+
public TaskView(Context context) {
this(context, null);
}
@@ -273,6 +275,11 @@
return;
}
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
+ if (!mIsClickableAsLiveTile) {
+ return;
+ }
+
+ mIsClickableAsLiveTile = false;
RecentsView recentsView = getRecentsView();
RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet();
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false);
@@ -289,6 +296,7 @@
public void onAnimationEnd(Animator animator) {
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(true);
recentsView.finishRecentsAnimation(false, null);
+ mIsClickableAsLiveTile = true;
}
});
anim.start();
@@ -348,6 +356,10 @@
return false;
}
+ public void setIsClickableAsLiveTile(boolean isClickableAsLiveTile) {
+ mIsClickableAsLiveTile = isClickableAsLiveTile;
+ }
+
private void computeAndSetIconTouchDelegate() {
float iconHalfSize = mIconView.getWidth() / 2f;
mIconCenterCoords[0] = mIconCenterCoords[1] = iconHalfSize;