From 83f58f2d2cefa4e150175fc9d976c170453a03b8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 3 May 2018 12:38:18 -0700 Subject: [PATCH] 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 --- .../src/com/android/quickstep/views/RecentsView.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 426365405e..160acb5b2f 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1160,15 +1160,18 @@ public abstract class RecentsView extends PagedView impl 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 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(