From c762ef68d40b6975bcaa0709f59f4c74f7175990 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Sat, 4 Mar 2023 01:42:26 +0000 Subject: [PATCH] Log when taskbar is in task switcher container. Test: wwdebug & wwlogcat Bug: 261177876 Change-Id: Id4eda7ee7e4e2c1aa60e07d5b65410b3847d9ac6 --- protos/launcher_atom.proto | 5 +++++ .../taskbar/LauncherTaskbarUIController.java | 5 +++++ .../taskbar/TaskbarActivityContext.java | 17 +++++++++-------- .../taskbar/TaskbarLauncherStateController.java | 4 ++++ .../launcher3/taskbar/TaskbarUIController.java | 5 +++++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/protos/launcher_atom.proto b/protos/launcher_atom.proto index c638ba94d7..59829a6b30 100644 --- a/protos/launcher_atom.proto +++ b/protos/launcher_atom.proto @@ -128,6 +128,11 @@ message TaskBarContainer { // Bit encoded value to capture pinned and predicted taskbar positions. optional int32 cardinality = 2; + + // Container where taskbar was invoked. + oneof ParentContainer { + TaskSwitcherContainer task_switcher_container = 3; + } } // Next value 44 diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index ac2c44ba27..b3836bdaa6 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -348,6 +348,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController { .getValue() == 0; } + @Override + protected boolean isInOverview() { + return mTaskbarLauncherStateController.isInOverview(); + } + @Override public RecentsView getRecentsView() { return mLauncher.getOverviewPanel(); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 2864ac7d3c..81389abf01 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -432,11 +432,16 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } LauncherAtom.ContainerInfo oldContainer = itemInfoBuilder.getContainerInfo(); + LauncherAtom.TaskBarContainer.Builder taskbarBuilder = + LauncherAtom.TaskBarContainer.newBuilder(); + if (mControllers.uiController.isInOverview()) { + taskbarBuilder.setTaskSwitcherContainer( + LauncherAtom.TaskSwitcherContainer.newBuilder()); + } + if (oldContainer.hasPredictedHotseatContainer()) { LauncherAtom.PredictedHotseatContainer predictedHotseat = oldContainer.getPredictedHotseatContainer(); - LauncherAtom.TaskBarContainer.Builder taskbarBuilder = - LauncherAtom.TaskBarContainer.newBuilder(); if (predictedHotseat.hasIndex()) { taskbarBuilder.setIndex(predictedHotseat.getIndex()); @@ -449,8 +454,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext { .setTaskBarContainer(taskbarBuilder)); } else if (oldContainer.hasHotseat()) { LauncherAtom.HotseatContainer hotseat = oldContainer.getHotseat(); - LauncherAtom.TaskBarContainer.Builder taskbarBuilder = - LauncherAtom.TaskBarContainer.newBuilder(); if (hotseat.hasIndex()) { taskbarBuilder.setIndex(hotseat.getIndex()); @@ -462,8 +465,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext { LauncherAtom.FolderContainer.Builder folderBuilder = oldContainer.getFolder() .toBuilder(); LauncherAtom.HotseatContainer hotseat = folderBuilder.getHotseat(); - LauncherAtom.TaskBarContainer.Builder taskbarBuilder = - LauncherAtom.TaskBarContainer.newBuilder(); if (hotseat.hasIndex()) { taskbarBuilder.setIndex(hotseat.getIndex()); @@ -476,11 +477,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } else if (oldContainer.hasAllAppsContainer()) { itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder() .setAllAppsContainer(oldContainer.getAllAppsContainer().toBuilder() - .setTaskbarContainer(LauncherAtom.TaskBarContainer.newBuilder()))); + .setTaskbarContainer(taskbarBuilder))); } else if (oldContainer.hasPredictionContainer()) { itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder() .setPredictionContainer(oldContainer.getPredictionContainer().toBuilder() - .setTaskbarContainer(LauncherAtom.TaskBarContainer.newBuilder()))); + .setTaskbarContainer(taskbarBuilder))); } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 5ac0570b29..4d163aa0c0 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -406,6 +406,10 @@ import java.util.StringJoiner; return mLauncherState != LauncherState.ALL_APPS; } + boolean isInOverview() { + return mLauncherState == LauncherState.OVERVIEW; + } + private void playStateTransitionAnim(AnimatorSet animatorSet, long duration, boolean committed) { boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java index b552e9bd18..033b075ec8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java @@ -166,6 +166,11 @@ public class TaskbarUIController { return true; } + /** Returns {@code true} if Taskbar is currently within overview. */ + protected boolean isInOverview() { + return false; + } + @CallSuper protected void dumpLogs(String prefix, PrintWriter pw) { pw.println(String.format(