Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +21 −7 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.hardware.SensorManager; import android.hardware.devicestate.DeviceStateManager; import android.os.Bundle; import android.os.CancellationSignal; import android.os.IBinder; import android.view.View; import android.view.WindowInsets; import android.window.SplashScreen; Loading Loading @@ -513,11 +514,26 @@ public abstract class BaseQuickstepLauncher extends Launcher } /** * Adds a new launch cookie for the activity launch of the given {@param info} if supported. * Adds a new launch cookie for the activity launch if supported. * * @param info the item info for the launch * @param opts the options to set the launchCookie on. */ public void addLaunchCookie(ItemInfo info, ActivityOptions opts) { IBinder launchCookie = getLaunchCookie(info); if (launchCookie != null) { opts.setLaunchCookie(launchCookie); } } /** * Return a new launch cookie for the activity launch if supported. * * @param info the item info for the launch */ public IBinder getLaunchCookie(ItemInfo info) { if (info == null) { return; return null; } switch (info.container) { case LauncherSettings.Favorites.CONTAINER_DESKTOP: Loading @@ -531,8 +547,7 @@ public abstract class BaseQuickstepLauncher extends Launcher break; } // Reset any existing launch cookies associated with the cookie opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID)); return; return ObjectWrapper.wrap(NO_MATCHING_ID); } switch (info.itemType) { case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION: Loading @@ -543,10 +558,9 @@ public abstract class BaseQuickstepLauncher extends Launcher break; default: // Reset any existing launch cookies associated with the cookie opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID)); return; return ObjectWrapper.wrap(NO_MATCHING_ID); } opts.setLaunchCookie(ObjectWrapper.wrap(new Integer(info.id))); return ObjectWrapper.wrap(new Integer(info.id)); } public void setHintUserWillBeActive() { Loading quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +9 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. Loading @@ -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); Loading Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +21 −7 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.hardware.SensorManager; import android.hardware.devicestate.DeviceStateManager; import android.os.Bundle; import android.os.CancellationSignal; import android.os.IBinder; import android.view.View; import android.view.WindowInsets; import android.window.SplashScreen; Loading Loading @@ -513,11 +514,26 @@ public abstract class BaseQuickstepLauncher extends Launcher } /** * Adds a new launch cookie for the activity launch of the given {@param info} if supported. * Adds a new launch cookie for the activity launch if supported. * * @param info the item info for the launch * @param opts the options to set the launchCookie on. */ public void addLaunchCookie(ItemInfo info, ActivityOptions opts) { IBinder launchCookie = getLaunchCookie(info); if (launchCookie != null) { opts.setLaunchCookie(launchCookie); } } /** * Return a new launch cookie for the activity launch if supported. * * @param info the item info for the launch */ public IBinder getLaunchCookie(ItemInfo info) { if (info == null) { return; return null; } switch (info.container) { case LauncherSettings.Favorites.CONTAINER_DESKTOP: Loading @@ -531,8 +547,7 @@ public abstract class BaseQuickstepLauncher extends Launcher break; } // Reset any existing launch cookies associated with the cookie opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID)); return; return ObjectWrapper.wrap(NO_MATCHING_ID); } switch (info.itemType) { case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION: Loading @@ -543,10 +558,9 @@ public abstract class BaseQuickstepLauncher extends Launcher break; default: // Reset any existing launch cookies associated with the cookie opts.setLaunchCookie(ObjectWrapper.wrap(NO_MATCHING_ID)); return; return ObjectWrapper.wrap(NO_MATCHING_ID); } opts.setLaunchCookie(ObjectWrapper.wrap(new Integer(info.id))); return ObjectWrapper.wrap(new Integer(info.id)); } public void setHintUserWillBeActive() { Loading
quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +9 −5 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. Loading @@ -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); Loading