Merge "Fix hotseat and prediction row to allow updates when empty." into ub-launcher3-master
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index b43d63b..1154964 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -1479,6 +1479,11 @@
         mGestureEndCallback = gestureEndCallback;
     }
 
+    @Override
+    public long getStartTouchTime() {
+        return mTouchTimeMs;
+    }
+
     protected void linkRecentsViewScroll() {
         SurfaceTransactionApplier.create(mRecentsView, applier -> {
             mTransformParams.setSyncTransactionApplier(applier);
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
index a21c714..f319b94 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java
@@ -160,5 +160,12 @@
          * Callback made when a task started from the recents is ready for an app transition.
          */
         default void onTaskAppeared(RemoteAnimationTargetCompat appearedTaskTarget) {}
+
+        /**
+         * The time in milliseconds of the touch event that starts the recents animation.
+         */
+        default long getStartTouchTime() {
+            return 0;
+        }
     }
 }
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 2666869..a214d81 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -17,7 +17,10 @@
 
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 
+import android.app.PictureInPictureParams;
+import android.content.ComponentName;
 import android.content.Context;
+import android.content.pm.ActivityInfo;
 import android.graphics.Bitmap;
 import android.graphics.Insets;
 import android.graphics.Rect;
@@ -380,4 +383,29 @@
             }
         }
     }
+
+    @Override
+    public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
+            PictureInPictureParams pictureInPictureParams, int launcherRotation, int shelfHeight) {
+        if (mSystemUiProxy != null) {
+            try {
+                return mSystemUiProxy.startSwipePipToHome(componentName, activityInfo,
+                        pictureInPictureParams, launcherRotation, shelfHeight);
+            } catch (RemoteException e) {
+                Log.w(TAG, "Failed call startSwipePipToHome", e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void stopSwipePipToHome(ComponentName componentName, Rect destinationBounds) {
+        if (mSystemUiProxy != null) {
+            try {
+                mSystemUiProxy.stopSwipePipToHome(componentName, destinationBounds);
+            } catch (RemoteException e) {
+                Log.w(TAG, "Failed call stopSwipePipToHome");
+            }
+        }
+    }
 }
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index f38c1ea..797797f 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -50,7 +50,7 @@
     public void preloadRecentsAnimation(Intent intent) {
         // Pass null animation handler to indicate this start is for preloading
         UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
-                .startRecentsActivity(intent, null, null, null, null));
+                .startRecentsActivity(intent, 0, null, null, null));
     }
 
     /**
@@ -119,10 +119,11 @@
                 }
             }
         });
+        final long eventTime = listener.getStartTouchTime();
         mCallbacks.addListener(gestureState);
         mCallbacks.addListener(listener);
         UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
-                .startRecentsActivity(intent, null, mCallbacks, null, null));
+                .startRecentsActivity(intent, eventTime, mCallbacks, null, null));
         gestureState.setState(STATE_RECENTS_ANIMATION_INITIALIZED);
         return mCallbacks;
     }
diff --git a/res/layout/search_section_title.xml b/res/layout/search_section_title.xml
index c541631..b7ba83e 100644
--- a/res/layout/search_section_title.xml
+++ b/res/layout/search_section_title.xml
@@ -17,8 +17,9 @@
     android:id="@+id/section_title"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:fontFamily="@style/TextHeadline"
-    android:textStyle="bold"
-    android:padding="4dp"
+    style="@style/TextHeadline"
+    android:paddingStart="4dp"
+    android:paddingBottom="2dp"
+    android:paddingTop="12dp"
     android:textColor="?android:attr/textColorPrimary"
-    android:textSize="14sp" />
\ No newline at end of file
+    android:textSize="18sp" />
\ No newline at end of file