Merge "Allow to show pinned taskbar when Launcher is visible" into main

This commit is contained in:
Toshiki Kikuchi
2024-09-18 23:16:57 +00:00
committed by Android (Google) Code Review
7 changed files with 100 additions and 4 deletions
@@ -50,6 +50,7 @@ import com.android.quickstep.util.GroupTask;
import com.android.quickstep.util.TISBindHelper;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -210,6 +211,9 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
*/
@Override
public void onLauncherVisibilityChanged(boolean isVisible) {
if (DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(mLauncher)) {
DisplayController.handleInfoChangeForLauncherVisibilityChanged(mLauncher);
}
onLauncherVisibilityChanged(isVisible, false /* fromInit */);
}
@@ -147,7 +147,11 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.bubbleBarBounds)
}
}
if (taskbarStashController.isInApp || taskbarStashController.isInOverview) {
if (
taskbarStashController.isInApp ||
taskbarStashController.isInOverview ||
DisplayController.showLockedTaskbarOnHome(context)
) {
// only add the taskbar touch region if not on home
val bottom = windowLayoutParams.height
val top = bottom - taskbarTouchableHeight
@@ -53,6 +53,7 @@ import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.quickstep.RecentsAnimationCallbacks;
import com.android.quickstep.RecentsAnimationController;
@@ -662,6 +663,9 @@ public class TaskbarLauncherStateController {
* This refers to the intended state - a transition to this state might be in progress.
*/
public boolean isTaskbarAlignedWithHotseat() {
if (DisplayController.showLockedTaskbarOnHome(mLauncher) && isInLauncher()) {
return false;
}
return mLauncherState.isTaskbarAlignedWithHotseat(mLauncher);
}
@@ -673,8 +677,7 @@ public class TaskbarLauncherStateController {
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
boolean willStashVisually = isInStashedState
&& mControllers.taskbarStashController.supportsVisualStashing();
boolean isTaskbarAlignedWithHotseat =
mLauncherState.isTaskbarAlignedWithHotseat(mLauncher);
boolean isTaskbarAlignedWithHotseat = isTaskbarAlignedWithHotseat();
return isTaskbarAlignedWithHotseat && !willStashVisually;
} else {
return false;
@@ -15,6 +15,7 @@
*/
package com.android.quickstep.util;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.view.Display.DEFAULT_DISPLAY;
import android.content.Context;
@@ -30,6 +31,8 @@ import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.util.window.CachedDisplayInfo;
import com.android.launcher3.util.window.WindowManagerProxy;
import com.android.quickstep.SystemUiProxy;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import java.util.List;
import java.util.Set;
@@ -65,6 +68,24 @@ public class SystemWindowManagerProxy extends WindowManagerProxy {
return desktopController != null && desktopController.areDesktopTasksVisible();
}
@Override
public boolean showLockedTaskbarOnHome(Context displayInfoContext) {
if (!DesktopModeStatus.canEnterDesktopMode(displayInfoContext)) {
return false;
}
if (!DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(displayInfoContext)) {
return false;
}
final boolean isFreeformDisplay = displayInfoContext.getResources().getConfiguration()
.windowConfiguration.getWindowingMode() == WINDOWING_MODE_FREEFORM;
return isFreeformDisplay;
}
@Override
public boolean isHomeVisible(Context context) {
return SystemUiProxy.INSTANCE.get(context).getHomeVisibilityState().isHomeVisible();
}
@Override
public int getRotation(Context displayInfoContext) {
return displayInfoContext.getResources().getConfiguration().windowConfiguration