Merge "Disabling fallback overview tests until the bug is fixed" into ub-launcher3-qt-dev
diff --git a/go/quickstep/res/layout/icon_recents_root_view.xml b/go/quickstep/res/layout/icon_recents_root_view.xml
index ea6fbc2..b64b7fd 100644
--- a/go/quickstep/res/layout/icon_recents_root_view.xml
+++ b/go/quickstep/res/layout/icon_recents_root_view.xml
@@ -24,7 +24,8 @@
         android:layout_width="@dimen/recents_list_width"
         android:layout_height="match_parent"
         android:layout_gravity="center_horizontal"
-        android:scrollbars="none"/>
+        android:scrollbars="none"
+        android:clipToPadding="false"/>
     <TextView
         android:id="@+id/recent_task_empty_view"
         android:layout_width="match_parent"
diff --git a/go/quickstep/res/values-sw480dp/dimens.xml b/go/quickstep/res/values-sw480dp/dimens.xml
new file mode 100644
index 0000000..be27d4b
--- /dev/null
+++ b/go/quickstep/res/values-sw480dp/dimens.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2019 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.
+-->
+<resources>
+    <dimen name="recents_list_width">480dp</dimen>
+
+    <dimen name="task_item_height">90dp</dimen>
+    <dimen name="task_item_top_margin">16dp</dimen>
+    <dimen name="task_thumbnail_icon_horiz_margin">20dp</dimen>
+
+    <dimen name="task_thumbnail_corner_radius">4dp</dimen>
+
+    <dimen name="clear_all_item_view_height">48dp</dimen>
+    <dimen name="clear_all_item_view_top_margin">28dp</dimen>
+    <dimen name="clear_all_item_view_landscape_bottom_margin">28dp</dimen>
+    <dimen name="clear_all_button_width">140dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 07e5f55..ce22489 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -54,6 +54,7 @@
 import androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener;
 
 import com.android.launcher3.BaseActivity;
+import com.android.launcher3.Insettable;
 import com.android.launcher3.R;
 import com.android.quickstep.ContentFillItemAnimator;
 import com.android.quickstep.RecentsModel;
@@ -74,7 +75,7 @@
  * Root view for the icon recents view. Acts as the main interface to the rest of the Launcher code
  * base.
  */
-public final class IconRecentsView extends FrameLayout {
+public final class IconRecentsView extends FrameLayout implements Insettable {
 
     public static final FloatProperty<IconRecentsView> CONTENT_ALPHA =
             new FloatProperty<IconRecentsView>("contentAlpha") {
@@ -518,4 +519,9 @@
         });
         mLayoutAnimation.start();
     }
+
+    @Override
+    public void setInsets(Rect insets) {
+        mTaskRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
+    }
 }
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
index 1b61a10..a5f5728 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
@@ -44,6 +44,7 @@
     private final Drawable mDefaultThumbnail;
     private final TaskLayerDrawable mIconDrawable;
     private final TaskLayerDrawable mThumbnailDrawable;
+    private View mTaskIconThumbnailView;
     private TextView mLabelView;
     private ImageView mIconView;
     private ImageView mThumbnailView;
@@ -79,6 +80,7 @@
     protected void onFinishInflate() {
         super.onFinishInflate();
         mLabelView = findViewById(R.id.task_label);
+        mTaskIconThumbnailView = findViewById(R.id.task_icon_and_thumbnail);
         mThumbnailView = findViewById(R.id.task_thumbnail);
         mIconView = findViewById(R.id.task_icon);
 
@@ -186,5 +188,6 @@
                 ((ThumbnailDrawable) drawable).setRequestedOrientation(newConfig.orientation);
             }
         }
+        mTaskIconThumbnailView.forceLayout();
     }
 }
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java b/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
index 0bad77b..eaefa21 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
@@ -56,7 +56,6 @@
         int width = height;
         setMeasuredDimension(width, height);
 
-
         int subItemSize = (int) (SUBITEM_FRAME_RATIO * height);
         if (mThumbnailView.getVisibility() != GONE) {
             boolean isPortrait =
diff --git a/quickstep/tests/src/com/android/quickstep/AppPredictionsUITests.java b/quickstep/tests/src/com/android/quickstep/AppPredictionsUITests.java
index 43f6039..72de80b 100644
--- a/quickstep/tests/src/com/android/quickstep/AppPredictionsUITests.java
+++ b/quickstep/tests/src/com/android/quickstep/AppPredictionsUITests.java
@@ -37,6 +37,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -49,7 +50,6 @@
 @LargeTest
 @RunWith(AndroidJUnit4.class)
 public class AppPredictionsUITests  extends AbstractQuickStepTest {
-    private static final int DEFAULT_APP_LAUNCH_TIMES = 3;
     private static final String TAG = "AppPredictionsUITests";
 
     private LauncherActivityInfo mSampleApp1;
@@ -86,6 +86,7 @@
      * Test that prediction UI is updated as soon as we get predictions from the system
      */
     @Test
+    @Ignore // b/131188880
     public void testPredictionExistsInAllApps() {
         mActivityMonitor.startLauncher();
         mLauncher.pressHome().switchToAllApps();
@@ -106,6 +107,7 @@
      * Test tat prediction update is deferred if it is already visible
      */
     @Test
+    @Ignore // b/131188880
     public void testPredictionsDeferredUntilHome() {
         mActivityMonitor.startLauncher();
         sendPredictionUpdate(mSampleApp1, mSampleApp2);
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 3e84440..dedc6b3 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -111,7 +111,7 @@
         mLauncher = new LauncherInstrumentation(instrumentation);
 
         // b/130558787; b/131419978
-        if (TestHelpers.isInLauncherProcess()) {
+        if (TestHelpers.isInLauncherProcess() && !LauncherInstrumentation.needSlowGestures()) {
             try {
                 Class systemProps = Class.forName("android.os.SystemProperties");
                 Method getInt = systemProps.getMethod("getInt", String.class, int.class);
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 74a17ce..70d8cf7 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -28,7 +28,7 @@
  * Common overview pane for both Launcher and fallback recents
  */
 public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
-    private static final int FLING_SPEED = 1500;
+    private static final int FLING_SPEED = LauncherInstrumentation.needSlowGestures() ? 500 : 1500;
     private static final int FLINGS_FOR_DISMISS_LIMIT = 40;
 
     BaseOverview(LauncherInstrumentation launcher) {
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 27bc43e..f5c5a8d 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -191,7 +191,7 @@
         return NavigationModel.THREE_BUTTON;
     }
 
-    static boolean needSlowGestures() {
+    public static boolean needSlowGestures() {
         return Build.MODEL.contains("Cuttlefish");
     }
 
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 0b3bbd2..85e112a 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -36,7 +36,8 @@
  * Operations on the workspace screen.
  */
 public final class Workspace extends Home {
-    private static final float FLING_SPEED = 3500.0F;
+    private static final float FLING_SPEED =
+            LauncherInstrumentation.needSlowGestures() ? 1500.0F : 3500.0F;
     private static final int DRAG_DURACTION = 2000;
     private final UiObject2 mHotseat;