Merge "Register a remote animation for the next activity start" into sc-dev am: a1d303e531 am: 50fc77bd57

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14530596

Change-Id: I9dd62dd9135589e9531532b8a1f7bcb703e12f82
This commit is contained in:
Cyrus Boadway
2021-05-13 19:51:48 +00:00
committed by Automerger Merge Worker

View File

@@ -16,8 +16,11 @@
package com.android.launcher3.uioverrides;
import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Build;
import android.os.RemoteException;
import android.util.Log;
import android.util.Pair;
import android.view.View;
@@ -50,6 +53,18 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
Pair<Intent, ActivityOptions> options = remoteResponse.getLaunchOptions(hostView);
ActivityOptionsWrapper activityOptions = mLauncher.getAppTransitionManager()
.getActivityLaunchOptions(mLauncher, hostView);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !pendingIntent.isActivity()) {
// In the event this pending intent eventually launches an activity, i.e. a trampoline,
// use the Quickstep transition animation.
try {
ActivityTaskManager.getService()
.registerRemoteAnimationForNextActivityStart(
pendingIntent.getCreatorPackage(),
activityOptions.options.getRemoteAnimationAdapter());
} catch (RemoteException e) {
// Do nothing.
}
}
activityOptions.options.setPendingIntentLaunchFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Object itemInfo = hostView.getTag();
if (itemInfo instanceof ItemInfo) {