summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quickstep/src/com/android/quickstep/util/RecentsAnimationListenerSet.java8
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java10
2 files changed, 16 insertions, 2 deletions
diff --git a/quickstep/src/com/android/quickstep/util/RecentsAnimationListenerSet.java b/quickstep/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
index 3e4956833..686e74d15 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
@@ -58,7 +58,7 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
SwipeAnimationTargetSet targetSet = new SwipeAnimationTargetSet(controller, targets,
homeContentInsets, minimizedHomeBounds);
Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> {
- for (SwipeAnimationListener listener : mListeners) {
+ for (SwipeAnimationListener listener : getListeners()) {
listener.onRecentsAnimationStart(targetSet);
}
});
@@ -67,9 +67,13 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
@Override
public final void onAnimationCanceled() {
Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> {
- for (SwipeAnimationListener listener : mListeners) {
+ for (SwipeAnimationListener listener : getListeners()) {
listener.onRecentsAnimationCanceled();
}
});
}
+
+ private SwipeAnimationListener[] getListeners() {
+ return mListeners.toArray(new SwipeAnimationListener[mListeners.size()]);
+ }
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 466bc5ed0..acdcd754d 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -266,6 +266,16 @@ public final class LauncherInstrumentation {
event -> true,
"Pressing Home didn't produce any events");
mDevice.waitForIdle();
+
+ // Temporarily press home twice as the first click sometimes gets ignored (b/124239413)
+ executeAndWaitForEvent(
+ () -> {
+ log("LauncherInstrumentation.pressHome before clicking");
+ getSystemUiObject("home").click();
+ },
+ event -> true,
+ "Pressing Home didn't produce any events");
+ mDevice.waitForIdle();
return getWorkspace();
}