From 2a77ff74bdffd2c4d956852e5246b5761a43014a Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 7 Oct 2021 13:46:26 -0700 Subject: [PATCH] Suspend auto-hiding taskbar when folder is open * Notify SystemUi to suspend autoHide behavior until launcher notifies otherwise * There's no exclusive lock for AutoHideController behavior, so down the road another component can choose to resume auto-hide behavior even if launcher has requested otherwise (and vice versa), something to keep in mind. Fixes: 193938507 Test: Opened folder while in immersive video, taskbar stayed open. Change-Id: I12f4055911822893551683466cfd532c8108a3a0 --- .../taskbar/TaskbarActivityContext.java | 2 ++ .../src/com/android/quickstep/SystemUiProxy.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 0316333a9d..bdadd2eb71 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -67,6 +67,7 @@ import com.android.launcher3.util.ViewCache; import com.android.launcher3.views.ActivityContext; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode.Mode; +import com.android.quickstep.SystemUiProxy; import com.android.quickstep.util.ScopedUnfoldTransitionProgressProvider; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -342,6 +343,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ * Updates the TaskbarContainer to MATCH_PARENT vs original Taskbar size. */ public void setTaskbarWindowFullscreen(boolean fullscreen) { + SystemUiProxy.INSTANCE.getNoCreate().notifyTaskbarAutohideSuspend(fullscreen); mIsFullscreen = fullscreen; setTaskbarWindowHeight(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenHeight); } diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 61540d1419..d9319a9b00 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -418,6 +418,22 @@ public class SystemUiProxy implements ISystemUiProxy, } } + /** + * NOTE: If called to suspend, caller MUST call this method to also un-suspend + * @param suspend should be true to stop auto-hide, false to resume normal behavior + */ + @Override + public void notifyTaskbarAutohideSuspend(boolean suspend) { + if (mSystemUiProxy != null) { + try { + mSystemUiProxy.notifyTaskbarAutohideSuspend(suspend); + } catch (RemoteException e) { + Log.w(TAG, "Failed call notifyTaskbarAutohideSuspend with arg: " + + suspend, e); + } + } + } + @Override public void handleImageBundleAsScreenshot(Bundle screenImageBundle, Rect locationInScreen, Insets visibleInsets, Task.TaskKey task) {