Merge changes from topic "presubmit-am-65236292503c47e89824f0dfda012d6a" into tm-mainline-prod

* changes:
  [automerge] Revert "Animate overivew actions view hiding on scroll." 2p: f5f14acba3
  Revert "Animate overivew actions view hiding on scroll."
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index f1af348..dd201e5 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -145,39 +145,22 @@
         launcher:numFolderColumns="3"
         launcher:numHotseatIcons="6"
         launcher:numAllAppsColumns="6"
-        launcher:isScalable="true"
-        launcher:devicePaddingId="@xml/paddings_6x5"
         launcher:dbFile="launcher_6_by_5.db"
         launcher:defaultLayoutId="@xml/default_workspace_6x5"
-        launcher:deviceCategory="tablet">
+        launcher:deviceCategory="tablet" >
 
         <display-option
             launcher:name="Tablet"
             launcher:minWidthDps="900"
             launcher:minHeightDps="820"
-            launcher:minCellHeight="120"
-            launcher:minCellWidth="102"
-            launcher:minCellHeightLandscape="104"
-            launcher:minCellWidthLandscape="120"
+            launcher:minCellHeight="104"
+            launcher:minCellWidth="80"
             launcher:iconImageSize="60"
             launcher:iconTextSize="14"
-            launcher:borderSpaceHorizontal="16"
-            launcher:borderSpaceVertical="64"
-            launcher:borderSpaceLandscapeHorizontal="64"
-            launcher:borderSpaceLandscapeVertical="16"
-            launcher:horizontalMargin="54"
-            launcher:horizontalMarginLandscape="120"
-            launcher:allAppsCellWidth="96"
-            launcher:allAppsCellHeight="142"
-            launcher:allAppsCellWidthLandscape="126"
-            launcher:allAppsCellHeightLandscape="126"
+            launcher:borderSpace="16"
             launcher:allAppsIconSize="60"
             launcher:allAppsIconTextSize="14"
-            launcher:allAppsBorderSpaceHorizontal="8"
-            launcher:allAppsBorderSpaceVertical="16"
-            launcher:allAppsBorderSpaceLandscape="16"
-            launcher:hotseatBorderSpace="58"
-            launcher:hotseatBorderSpaceLandscape="50.4"
+            launcher:allAppsBorderSpace="16"
             launcher:canBeDefault="true" />
 
     </grid-option>
diff --git a/res/xml/paddings_6x5.xml b/res/xml/paddings_6x5.xml
deleted file mode 100644
index a958ec7..0000000
--- a/res/xml/paddings_6x5.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2022 The Android Open Source Project
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~      http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<device-paddings xmlns:launcher="http://schemas.android.com/apk/res-auto" >
-
-    <!--  Some non default screen sizes  -->
-    <device-padding
-        launcher:maxEmptySpace="30dp">
-        <workspaceTopPadding
-            launcher:a="0.34"
-            launcher:b="0"/>
-        <workspaceBottomPadding
-            launcher:a="0.26"
-            launcher:b="0"/>
-        <hotseatBottomPadding
-            launcher:a="0.4"
-            launcher:b="0"/>
-    </device-padding>
-
-    <device-padding
-        launcher:maxEmptySpace="80dp">
-        <workspaceTopPadding
-            launcher:a="0"
-            launcher:b="20dp"/>
-        <workspaceBottomPadding
-            launcher:a="0.4"
-            launcher:b="0"
-            launcher:c="20dp"/>
-        <hotseatBottomPadding
-            launcher:a="0.6"
-            launcher:b="0"
-            launcher:c="20dp"/>
-    </device-padding>
-
-    <device-padding
-        launcher:maxEmptySpace="280dp">
-        <workspaceTopPadding
-            launcher:a="0"
-            launcher:b="112dp"/>
-        <workspaceBottomPadding
-            launcher:a="0.4"
-            launcher:b="0"
-            launcher:c="112dp"/>
-        <hotseatBottomPadding
-            launcher:a="0.6"
-            launcher:b="0"
-            launcher:c="112dp"/>
-    </device-padding>
-
-    <device-padding
-        launcher:maxEmptySpace="9999dp">
-        <workspaceTopPadding
-            launcher:a="0.40"
-            launcher:c="36dp"/>
-        <workspaceBottomPadding
-            launcher:a="0.60"
-            launcher:c="36dp"/>
-        <hotseatBottomPadding
-            launcher:a="0"
-            launcher:b="36dp"/>
-    </device-padding>
-</device-paddings>
\ No newline at end of file
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index ceb38d0..4386f41 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -66,7 +66,8 @@
             TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP,
             TYPE_WIDGETS_EDUCATION_DIALOG,
             TYPE_TASKBAR_EDUCATION_DIALOG,
-            TYPE_TASKBAR_ALL_APPS
+            TYPE_TASKBAR_ALL_APPS,
+            TYPE_OPTIONS_POPUP_DIALOG
     })
     @Retention(RetentionPolicy.SOURCE)
     public @interface FloatingViewType {}
@@ -86,6 +87,7 @@
     public static final int TYPE_TASK_MENU = 1 << 11;
     public static final int TYPE_OPTIONS_POPUP = 1 << 12;
     public static final int TYPE_ICON_SURFACE = 1 << 13;
+    public static final int TYPE_OPTIONS_POPUP_DIALOG = 1 << 18;
 
     public static final int TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP = 1 << 14;
     public static final int TYPE_WIDGETS_EDUCATION_DIALOG = 1 << 15;
@@ -97,13 +99,14 @@
             | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE | TYPE_TASK_MENU
             | TYPE_OPTIONS_POPUP | TYPE_SNACKBAR | TYPE_LISTENER | TYPE_ALL_APPS_EDU
             | TYPE_ICON_SURFACE | TYPE_DRAG_DROP_POPUP | TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP
-            | TYPE_WIDGETS_EDUCATION_DIALOG | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS;
+            | TYPE_WIDGETS_EDUCATION_DIALOG | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS
+            | TYPE_OPTIONS_POPUP_DIALOG;
 
     // Type of popups which should be kept open during launcher rebind
     public static final int TYPE_REBIND_SAFE = TYPE_WIDGETS_FULL_SHEET
             | TYPE_WIDGETS_BOTTOM_SHEET | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE
             | TYPE_ALL_APPS_EDU | TYPE_ICON_SURFACE | TYPE_WIDGETS_EDUCATION_DIALOG
-            | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS;
+            | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS | TYPE_OPTIONS_POPUP_DIALOG;
 
     // Usually we show the back button when a floating view is open. Instead, hide for these types.
     public static final int TYPE_HIDE_BACK_BUTTON = TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 847a9bf..3cc8a81 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -237,8 +237,8 @@
 /**
  * Default launcher application.
  */
-public class Launcher extends StatefulActivity<LauncherState> implements LauncherExterns,
-        Callbacks, InvariantDeviceProfile.OnIDPChangeListener,
+public class Launcher extends StatefulActivity<LauncherState>
+        implements LauncherExterns, Callbacks, InvariantDeviceProfile.OnIDPChangeListener,
         PluginListener<LauncherOverlayPlugin>, LauncherOverlayCallbacks {
     public static final String TAG = "Launcher";
 
@@ -304,7 +304,7 @@
     private Configuration mOldConfig;
 
     @Thunk
-    Workspace mWorkspace;
+    Workspace<?> mWorkspace;
     @Thunk
     DragLayer mDragLayer;
     private DragController mDragController;
@@ -1527,7 +1527,7 @@
         return mAppsView;
     }
 
-    public Workspace getWorkspace() {
+    public Workspace<?> getWorkspace() {
         return mWorkspace;
     }
 
@@ -3234,11 +3234,12 @@
     /** Pauses view updates that should not be run during the app launch animation. */
     public void pauseExpensiveViewUpdates() {
         // Pause page indicator animations as they lead to layer trashing.
-        getWorkspace().getPageIndicator().pauseAnimations();
+        mWorkspace.getPageIndicator().pauseAnimations();
     }
 
     /** Resumes view updates at the end of the app launch animation. */
     public void resumeExpensiveViewUpdates() {
-        getWorkspace().getPageIndicator().skipAnimationsToEnd();
+        mWorkspace.getPageIndicator().skipAnimationsToEnd();
     }
+
 }
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index ea9b69c..61090e7 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -92,7 +92,7 @@
 import com.android.launcher3.model.data.LauncherAppWidgetInfo;
 import com.android.launcher3.model.data.SearchActionItemInfo;
 import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.pageindicators.WorkspacePageIndicator;
+import com.android.launcher3.pageindicators.PageIndicator;
 import com.android.launcher3.popup.PopupContainerWithArrow;
 import com.android.launcher3.statemanager.StateManager;
 import com.android.launcher3.statemanager.StateManager.StateHandler;
@@ -134,8 +134,9 @@
  * The workspace is a wide area with a wallpaper and a finite number of pages.
  * Each page contains a number of icons, folders or widgets the user can
  * interact with. A workspace is meant to be used with a fixed width only.
+ * @param <T> Class that extends View and PageIndicator
  */
-public class Workspace extends PagedView<WorkspacePageIndicator>
+public class Workspace<T extends View & PageIndicator> extends PagedView<T>
         implements DropTarget, DragSource, View.OnTouchListener,
         DragController.DragListener, Insettable, StateHandler<LauncherState>,
         WorkspaceLayoutManager, LauncherBindableItemsContainer {
diff --git a/src/com/android/launcher3/pageindicators/PageIndicator.java b/src/com/android/launcher3/pageindicators/PageIndicator.java
index 8fafb6f..5967be7 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicator.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicator.java
@@ -25,4 +25,24 @@
     void setActiveMarker(int activePage);
 
     void setMarkersCount(int numMarkers);
+
+    /**
+     * Sets the flag if the Page Indicator should autohide.
+     * @param shouldAutoHide
+     */
+    default void setShouldAutoHide(boolean shouldAutoHide) {
+        //No-op by default
+    }
+    /**
+     * Pauses all currently running animations.
+     */
+    default void pauseAnimations() {
+        //No-op by default
+    }
+    /**
+     * Force-ends all currently running or paused animations.
+     */
+    default void skipAnimationsToEnd() {
+        //No-op by default
+    }
 }
diff --git a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java b/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java
index c685891..1681ea5 100644
--- a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java
+++ b/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java
@@ -187,6 +187,7 @@
         }
     }
 
+    @Override
     public void setShouldAutoHide(boolean shouldAutoHide) {
         mShouldAutoHide = shouldAutoHide;
         if (shouldAutoHide && mLinePaint.getAlpha() > 0) {
@@ -236,6 +237,7 @@
     /**
      * Pauses all currently running animations.
      */
+    @Override
     public void pauseAnimations() {
         for (int i = 0; i < ANIMATOR_COUNT; i++) {
             if (mAnimators[i] != null) {
@@ -247,6 +249,7 @@
     /**
      * Force-ends all currently running or paused animations.
      */
+    @Override
     public void skipAnimationsToEnd() {
         for (int i = 0; i < ANIMATOR_COUNT; i++) {
             if (mAnimators[i] != null) {