diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java index 5d3a1520fc..ff08e3dda7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java @@ -160,6 +160,7 @@ public class TaskbarControllers { taskbarForceVisibleImmersiveController.onDestroy(); taskbarAllAppsController.onDestroy(); navButtonController.onDestroy(); + taskbarInsetsController.onDestroy(); mControllersToLog = null; } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt index 9571798d53..9870a2e0bf 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt @@ -18,6 +18,7 @@ package com.android.launcher3.taskbar import android.graphics.Insets import android.view.WindowManager import com.android.launcher3.AbstractFloatingView +import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS import com.android.launcher3.R import com.android.launcher3.anim.AlphaUpdateListener import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController @@ -61,6 +62,8 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask windowLayoutParams.insetsRoundedCornerFrame = true } + fun onDestroy() {} + fun onTaskbarWindowHeightOrInsetsChanged() { var reducingSize = getReducingInsetsForTaskbarInsetsHeight( controllers.taskbarStashController.contentHeightToReportToApps) @@ -106,18 +109,11 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask } else if (controllers.taskbarDragController.isSystemDragInProgress) { // Let touches pass through us. insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION) - } else if (AbstractFloatingView.getOpenView( - context, - AbstractFloatingView.TYPE_TASKBAR_ALL_APPS - ) != null - ) { + } else if (AbstractFloatingView.hasOpenView(context, TYPE_TASKBAR_ALL_APPS)) { // Let touches pass through us. insetsInfo.setTouchableInsets(InsetsInfo.TOUCHABLE_INSETS_REGION) } else if (controllers.taskbarViewController.areIconsVisible() - || AbstractFloatingView.getOpenView( - context, - AbstractFloatingView.TYPE_ALL - ) != null + || AbstractFloatingView.hasOpenView(context, AbstractFloatingView.TYPE_ALL) || context.isNavBarKidsModeActive ) { // Taskbar has some touchable elements, take over the full taskbar area diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java index 4386f4196c..90869c2965 100644 --- a/src/com/android/launcher3/AbstractFloatingView.java +++ b/src/com/android/launcher3/AbstractFloatingView.java @@ -207,6 +207,13 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch return getView(activity, type, true /* mustBeOpen */); } + /** + * Returns whether there is at least one view of the given type where {@link #isOpen()} == true. + */ + public static boolean hasOpenView(ActivityContext activity, @FloatingViewType int type) { + return getOpenView(activity, type) != null; + } + /** * Returns a view matching FloatingViewType, and {@link #isOpen()} may be false (if animating * closed).