Merge "Always go to home in case of fling-up am: 64155533b6 am: 6991a015ad" into qt-r1-dev-plus-aosp
am: 641a5264d9
Change-Id: Ia62e9fc6dbd44e57bf6741bccd9563450c08fe72
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
index 8f1282d..24fc61b 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionAppTracker.java
@@ -95,6 +95,10 @@
private AppPredictor createPredictor(Client client, int count) {
AppPredictionManager apm = mContext.getSystemService(AppPredictionManager.class);
+ if (apm == null) {
+ return null;
+ }
+
AppPredictor predictor = apm.createAppPredictionSession(
new AppPredictionContext.Builder(mContext)
.setUiSurface(client.id)
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
index 83601e6..14083dd 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java
@@ -23,6 +23,7 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Preconditions;
import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener;
+import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RecentsAnimationListener;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -39,7 +40,7 @@
public class RecentsAnimationListenerSet implements RecentsAnimationListener {
// The actual app surface is replaced by a screenshot upon recents animation cancelation when
- // deferredWithScreenshot is true. Launcher takes the responsibility to clean up this screenshot
+ // the thumbnailData exists. Launcher takes the responsibility to clean up this screenshot
// after app transition is finished. This delay is introduced to cover the app transition
// period of time.
private final int TRANSITION_DELAY = 100;
@@ -90,14 +91,14 @@
}
@Override
- public final void onAnimationCanceled(boolean deferredWithScreenshot) {
+ public final void onAnimationCanceled(ThumbnailData thumbnailData) {
Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> {
for (SwipeAnimationListener listener : getListeners()) {
listener.onRecentsAnimationCanceled();
}
});
// TODO: handle the transition better instead of simply using a transition delay.
- if (deferredWithScreenshot) {
+ if (thumbnailData != null) {
MAIN_THREAD_EXECUTOR.getHandler().postDelayed(() -> mController.cleanupScreenshot(),
TRANSITION_DELAY);
}
@@ -109,6 +110,6 @@
public void cancelListener() {
mCancelled = true;
- onAnimationCanceled(false);
+ onAnimationCanceled(null);
}
}