Fix incorrect reporting of launch failure
- Launcher uses the same consumer to handle task launch failure and
animation-cancel, so only show the notification when it is an
actual launch failure.
Bug: 79209142
Change-Id: I6b708ac9888673056f2c6de1d5aee4a281c61027
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 4263654..160acb5 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -1160,15 +1160,18 @@
onTaskLaunched(result);
tv.setVisibility(VISIBLE);
getOverlay().remove(drawable);
- if (!result) {
- tv.notifyTaskLaunchFailed(TAG);
- }
};
mPendingAnimation = new PendingAnimation(anim);
mPendingAnimation.addEndListener((onEndListener) -> {
if (onEndListener.isSuccess) {
- tv.launchTask(false, onTaskLaunchFinish, getHandler());
+ Consumer<Boolean> onLaunchResult = (result) -> {
+ onTaskLaunchFinish.accept(result);
+ if (!result) {
+ tv.notifyTaskLaunchFailed(TAG);
+ }
+ };
+ tv.launchTask(false, onLaunchResult, getHandler());
Task task = tv.getTask();
if (task != null) {
mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss(