Merge "Adding open/close animartion when launching app-info target" into main

This commit is contained in:
Sunny Goyal authored and Android (Google) Code Review committed 2024-09-11 20:31:34 +00:00
commit 8f8932b0f8
7 files changed
+25 -26

No files matched your search

@@ -320,7 +320,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
* @return ActivityOptions with remote animations that controls how the window of the opening
* targets are displayed.
*/
public ActivityOptionsWrapper getActivityLaunchOptions(View v) {
public ActivityOptionsWrapper getActivityLaunchOptions(View v, ItemInfo itemInfo) {
boolean fromRecents = isLaunchingFromRecents(v, null /* targets */);
RunnableList onEndCallback = new RunnableList();
@@ -350,7 +350,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
IBinder cookie = mAppLaunchRunner.supportsReturnTransition()
? ((ContainerAnimationRunner) mAppLaunchRunner).getCookie() : null;
addLaunchCookie(cookie, (ItemInfo) v.getTag(), options);
addLaunchCookie(cookie, itemInfo, options);
// Register the return animation so it can be triggered on back from the app to home.
maybeRegisterAppReturnTransition(v);
@@ -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);
}
@@ -1190,7 +1190,8 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
@Override
public ActivityOptionsWrapper getActivityLaunchOptions(View v, @Nullable ItemInfo item) {
ActivityOptionsWrapper activityOptions = mAppTransitionManager.getActivityLaunchOptions(v);
ActivityOptionsWrapper activityOptions = mAppTransitionManager.getActivityLaunchOptions(
v, item != null ? item : (ItemInfo) v.getTag());
if (mLastTouchUpTime > 0) {
activityOptions.options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_LAUNCHER,
mLastTouchUpTime);