From 148cbffdbf604ad1770cb09d77c4bc5b5e54a77f Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Thu, 4 Apr 2024 15:19:02 -0400 Subject: [PATCH] Add debug logs to TaskView Investigating b/332386996 Flag: N/A Bug: 332386996 Test: TaplTestsQuickstep#testQuickSwitchFromApp Change-Id: I633a1a67cadc8f1f85fbdeb3a0913623ae817bf1 --- .../src/com/android/quickstep/views/TaskView.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index abd4ec4eae..47f0168fc0 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -653,6 +653,7 @@ public class TaskView extends FrameLayout implements Reusable { */ public void bind(Task task, RecentsOrientedState orientedState) { cancelPendingLoadTasks(); + testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, "TaskView.bind: task=" + task); mTask = task; mTaskIdContainer[0] = mTask.key.id; mTaskIdAttributeContainer[0] = new TaskIdAttributeContainer(task, mSnapshotView, mIconView, @@ -860,6 +861,8 @@ public class TaskView extends FrameLayout implements Reusable { */ @Nullable public RunnableList launchTaskAnimated() { + testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, + "TaskView.launchTaskAnimated: mTask=" + mTask); if (mTask != null) { testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, "TaskView.launchTaskAnimated: startActivityFromRecentsAsync"); @@ -910,6 +913,7 @@ public class TaskView extends FrameLayout implements Reusable { * Starts the task associated with this view without any animation */ public void launchTask(@NonNull Consumer callback, boolean isQuickswitch) { + testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, "TaskView.launchTask: mTask=" + mTask); if (mTask != null) { testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, "TaskView.launchTask: startActivityFromRecentsAsync"); @@ -980,6 +984,9 @@ public class TaskView extends FrameLayout implements Reusable { public RunnableList launchTasks() { RecentsView recentsView = getRecentsView(); RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles; + testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, + "TaskView.launchTasks: isRunningTask=" + isRunningTask() + ", " + + "remoteTargetHandles == null?" + (remoteTargetHandles == null)); if (isRunningTask() && remoteTargetHandles != null) { if (!mIsClickableAsLiveTile) { Log.e(TAG, "TaskView is not clickable as a live tile; returning to home."); @@ -1007,7 +1014,7 @@ public class TaskView extends FrameLayout implements Reusable { // If the recents animation is cancelled somehow between the parent if block and // here, try to launch the task as a non live tile task. testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, - "TaskView.java - launchTasks: recents animation is cancelled"); + "TaskView.launchTasks: recents animation is cancelled"); RunnableList runnableList = launchTaskAnimated(); if (runnableList == null) { Log.e(TAG, "Recents animation cancelled and cannot launch task as non-live tile" @@ -1029,7 +1036,7 @@ public class TaskView extends FrameLayout implements Reusable { public void onAnimationEnd(Animator animator) { if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) { testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, - "TaskView.java - launchTasks: onAnimationEnd"); + "TaskView.launchTasks: onAnimationEnd"); launchTaskAnimated(); } mIsClickableAsLiveTile = true; @@ -1049,9 +1056,6 @@ public class TaskView extends FrameLayout implements Reusable { recentsView.onTaskLaunchedInLiveTileMode(); return runnableList; } else { - testLogD(SUCCESSFUL_GESTURE_MISMATCH_EVENTS, - "TaskView.java - launchTasks: isRunningTask=" + isRunningTask() + "||" - + "remoteTargetHandles == null?" + (remoteTargetHandles == null)); return launchTaskAnimated(); } }