Adding open/close animartion when launching app-info target
Bug: 356914468 Test: Verified manually Flag: EXEMPT bugfix Change-Id: I3a4e48363728153a96c75466824fb03de44c0ad9
This commit is contained in:
@@ -22,7 +22,6 @@ import android.app.ActivityOptions;
|
||||
import android.app.ActivityTaskManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
@@ -34,7 +33,6 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.ActivityOptionsWrapper;
|
||||
import com.android.launcher3.util.StableViewInfo;
|
||||
import com.android.launcher3.widget.LauncherAppWidgetHostView;
|
||||
|
||||
/** Provides a Quickstep specific animation when launching an activity from an app widget. */
|
||||
@@ -67,13 +65,7 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
|
||||
}
|
||||
Pair<Intent, ActivityOptions> options = remoteResponse.getLaunchOptions(view);
|
||||
ActivityOptionsWrapper activityOptions = mLauncher.getAppTransitionManager()
|
||||
.getActivityLaunchOptions(hostView);
|
||||
Object itemInfo = hostView.getTag();
|
||||
IBinder launchCookie = null;
|
||||
if (itemInfo instanceof ItemInfo info) {
|
||||
launchCookie = StableViewInfo.toLaunchCookie(info);
|
||||
activityOptions.options.setLaunchCookie(launchCookie);
|
||||
}
|
||||
.getActivityLaunchOptions(hostView, (ItemInfo) hostView.getTag());
|
||||
if (Utilities.ATLEAST_S && !pendingIntent.isActivity()) {
|
||||
// In the event this pending intent eventually launches an activity, i.e. a trampoline,
|
||||
// use the Quickstep transition animation.
|
||||
@@ -82,7 +74,7 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
|
||||
.registerRemoteAnimationForNextActivityStart(
|
||||
pendingIntent.getCreatorPackage(),
|
||||
activityOptions.options.getRemoteAnimationAdapter(),
|
||||
launchCookie);
|
||||
activityOptions.options.getLaunchCookie());
|
||||
} catch (RemoteException e) {
|
||||
// Do nothing.
|
||||
}
|
||||
@@ -93,7 +85,7 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
|
||||
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
|
||||
options = Pair.create(options.first, activityOptions.options);
|
||||
if (pendingIntent.isActivity()) {
|
||||
logAppLaunch(itemInfo);
|
||||
logAppLaunch(hostView.getTag());
|
||||
}
|
||||
return RemoteViews.startPendingIntent(hostView, pendingIntent, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user