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
This commit is contained in:
Winson Chung
2018-05-03 12:38:18 -07:00
parent 3f596f649d
commit 83f58f2d2c

View File

@@ -1160,15 +1160,18 @@ public abstract class RecentsView<T extends BaseActivity> 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<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(