Merge "Disable window corner rounding on some devices" into ub-launcher3-master
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index 73075dc..d0c255c 100644
--- a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -22,8 +22,6 @@
 
 import android.view.View;
 
-import androidx.annotation.Nullable;
-
 import com.android.launcher3.Launcher;
 import com.android.launcher3.LauncherStateManager.StateHandler;
 import com.android.launcher3.util.TouchController;
@@ -44,25 +42,12 @@
      * @param launcher the launcher activity
      * @return the touch controller for recents tasks
      */
-    public static @Nullable TouchController createTaskSwipeController(Launcher launcher) {
+    public static TouchController createTaskSwipeController(Launcher launcher) {
         // We leave all input handling to the view itself.
         return null;
     }
 
     /**
-     * Creates and returns a touch controller for swiping from overview state to the all apps state
-     * if such an action is supported.
-     *
-     * @param launcher the launcher activity
-     * @return the touch controller for swiping from overview to all apps
-     */
-    public static @Nullable TouchController createOverviewToAllAppsTouchController(
-            Launcher launcher) {
-        // Go does not support overview to all apps transition.
-        return null;
-    }
-
-    /**
      * Creates and returns the controller responsible for recents view state transitions.
      *
      * @param launcher the launcher activity
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index 0b62bee..f18f43c 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -22,14 +22,11 @@
 import static com.android.launcher3.LauncherState.NORMAL;
 import static com.android.launcher3.LauncherState.OVERVIEW;
 
-import androidx.annotation.Nullable;
-
 import com.android.launcher3.Launcher;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.LauncherStateManager.StateHandler;
 import com.android.launcher3.anim.AnimatorPlaybackController;
 import com.android.launcher3.util.TouchController;
-import com.android.quickstep.OverviewInteractionState;
 import com.android.quickstep.views.RecentsView;
 
 /**
@@ -48,28 +45,11 @@
      * @param launcher the launcher activity
      * @return the touch controller for recents tasks
      */
-    public static @Nullable TouchController createTaskSwipeController(Launcher launcher) {
+    public static TouchController createTaskSwipeController(Launcher launcher) {
         return new LauncherTaskViewController(launcher);
     }
 
     /**
-     * Creates and returns a touch controller for swiping from overview state to the all apps state
-     * if such an action is supported.
-     *
-     * @param launcher the launcher activity
-     * @return the touch controller for swiping from overview to all apps
-     */
-    public static @Nullable TouchController createOverviewToAllAppsTouchController(
-            Launcher launcher) {
-        boolean swipeUpEnabled = OverviewInteractionState.INSTANCE.get(launcher)
-                .isSwipeUpGestureEnabled();
-        if (!swipeUpEnabled || launcher.getDeviceProfile().isVerticalBarLayout()) {
-            return new OverviewToAllAppsTouchController(launcher);
-        }
-        return null;
-    }
-
-    /**
      * Creates and returns the controller responsible for recents view state transitions.
      *
      * @param launcher the launcher activity
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 7c47956..0c741a1 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -62,8 +62,4 @@
     <!-- Annotation shown on an app card in Recents, telling that the app has a usage limit set by
     the user, and a given time is left for it today [CHAR LIMIT=20] -->
     <string name="time_left_for_app"><xliff:g id="time" example="7 minutes">%1$s</xliff:g> left today</string>
-
-    <!-- Annotation shown on an app card in Recents, telling that the app is in a group that has a
-    usage limit set by the user, and a given time is left for the group today [CHAR LIMIT=20] -->
-    <string name="time_left_for_group"><xliff:g id="time" example="1 hour">%1$s</xliff:g> left for group</string>
 </resources>
\ No newline at end of file
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewToAllAppsTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewToAllAppsTouchController.java
similarity index 100%
rename from quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewToAllAppsTouchController.java
rename to quickstep/src/com/android/launcher3/uioverrides/OverviewToAllAppsTouchController.java
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index bc9069a..ff9d601 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -60,14 +60,15 @@
             WindowManagerWrapper.getInstance().setShelfHeight(visible != 0, height);
 
     public static TouchController[] createTouchControllers(Launcher launcher) {
+        boolean swipeUpEnabled = OverviewInteractionState.INSTANCE.get(launcher)
+                .isSwipeUpGestureEnabled();
         ArrayList<TouchController> list = new ArrayList<>();
         list.add(launcher.getDragController());
 
-        TouchController overviewToAllAppsController =
-                RecentsUiFactory.createOverviewToAllAppsTouchController(launcher);
-        if (overviewToAllAppsController != null) {
-            list.add(overviewToAllAppsController);
+        if (!swipeUpEnabled || launcher.getDeviceProfile().isVerticalBarLayout()) {
+            list.add(new OverviewToAllAppsTouchController(launcher));
         }
+
         if (launcher.getDeviceProfile().isVerticalBarLayout()) {
             list.add(new LandscapeEdgeSwipeController(launcher));
         } else {
diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
index aafd725..9ad750b 100644
--- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
+++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java
@@ -77,7 +77,6 @@
         Utilities.THREAD_POOL_EXECUTOR.execute(() -> {
             long appUsageLimitTimeMs = -1;
             long appRemainingTimeMs = -1;
-            boolean isGroupLimit = true;
 
             try {
                 final Method getAppUsageLimit = LauncherApps.class.getMethod(
@@ -95,8 +94,6 @@
                             invoke(usageLimit);
                     appRemainingTimeMs = (long) appUsageLimitClass.getMethod("getUsageRemaining").
                             invoke(usageLimit);
-                    isGroupLimit = (boolean) appUsageLimitClass.getMethod("isGroupLimit").
-                            invoke(usageLimit);
                 }
             } catch (Exception e) {
                 // Do nothing
@@ -104,14 +101,13 @@
 
             final long appUsageLimitTimeMsFinal = appUsageLimitTimeMs;
             final long appRemainingTimeMsFinal = appRemainingTimeMs;
-            final boolean isGroupLimitFinal = isGroupLimit;
 
             post(() -> {
                 if (appUsageLimitTimeMsFinal < 0) {
                     setVisibility(GONE);
                 } else {
                     setVisibility(VISIBLE);
-                    mText.setText(getText(appRemainingTimeMsFinal, isGroupLimitFinal));
+                    mText.setText(getText(appRemainingTimeMsFinal));
                     mImage.setImageResource(appRemainingTimeMsFinal > 0 ?
                             R.drawable.hourglass_top : R.drawable.hourglass_bottom);
                 }
@@ -119,9 +115,7 @@
                 callback.call(
                         appUsageLimitTimeMsFinal >= 0 && appRemainingTimeMsFinal <= 0 ? 0 : 1,
                         getContentDescriptionForTask(
-                                task, appUsageLimitTimeMsFinal,
-                                appRemainingTimeMsFinal,
-                                isGroupLimitFinal));
+                                task, appUsageLimitTimeMsFinal, appRemainingTimeMsFinal));
             });
         });
     }
@@ -185,12 +179,12 @@
                 duration, FormatWidth.NARROW, R.string.shorter_duration_less_than_one_minute);
     }
 
-    private String getText(long remainingTime, boolean isGroupLimit) {
+    private String getText(long remainingTime) {
         final Resources resources = getResources();
         return (remainingTime <= 0) ?
                 resources.getString(R.string.app_in_grayscale) :
                 resources.getString(
-                        isGroupLimit ? R.string.time_left_for_group : R.string.time_left_for_app,
+                        R.string.time_left_for_app,
                         getShorterReadableDuration(Duration.ofMillis(remainingTime)));
     }
 
@@ -214,12 +208,12 @@
     }
 
     private String getContentDescriptionForTask(
-            Task task, long appUsageLimitTimeMs, long appRemainingTimeMs, boolean isGroupLimit) {
+            Task task, long appUsageLimitTimeMs, long appRemainingTimeMs) {
         return appUsageLimitTimeMs >= 0 ?
                 getResources().getString(
                         R.string.task_contents_description_with_remaining_time,
                         task.titleDescription,
-                        getText(appRemainingTimeMs, isGroupLimit)) :
+                        getText(appRemainingTimeMs)) :
                 task.titleDescription;
     }
 }