mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Passing in the launch cookie for widget broadcast trampolines
The launch cookie can now be transfered via the broadcast Fixes: 220290671 Test: add Photos widget, return properly to widget Change-Id: Ibfe9e5232317837f3111459212a4b016b5828ef4
This commit is contained in:
@@ -21,6 +21,7 @@ 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;
|
||||
@@ -58,6 +59,12 @@ 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) {
|
||||
launchCookie = mLauncher.getLaunchCookie((ItemInfo) itemInfo);
|
||||
activityOptions.options.setLaunchCookie(launchCookie);
|
||||
}
|
||||
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.
|
||||
@@ -65,17 +72,14 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
|
||||
ActivityTaskManager.getService()
|
||||
.registerRemoteAnimationForNextActivityStart(
|
||||
pendingIntent.getCreatorPackage(),
|
||||
activityOptions.options.getRemoteAnimationAdapter());
|
||||
activityOptions.options.getRemoteAnimationAdapter(),
|
||||
launchCookie);
|
||||
} catch (RemoteException e) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
activityOptions.options.setPendingIntentLaunchFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
activityOptions.options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_EMPTY);
|
||||
Object itemInfo = hostView.getTag();
|
||||
if (itemInfo instanceof ItemInfo) {
|
||||
mLauncher.addLaunchCookie((ItemInfo) itemInfo, activityOptions.options);
|
||||
}
|
||||
options = Pair.create(options.first, activityOptions.options);
|
||||
if (pendingIntent.isActivity()) {
|
||||
logAppLaunch(itemInfo);
|
||||
|
||||
Reference in New Issue
Block a user