Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 148cbffd authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Add debug logs to TaskView

Investigating b/332386996

Flag: N/A
Bug: 332386996
Test: TaplTestsQuickstep#testQuickSwitchFromApp
Change-Id: I633a1a67cadc8f1f85fbdeb3a0913623ae817bf1
parent 41e4290d
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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<Boolean> 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();
        }
    }