Merge "Let sender permission allow background launch when starting recents" into main

This commit is contained in:
Riddle Hsu
2024-06-18 01:48:41 +00:00
committed by Android (Google) Code Review
2 changed files with 86 additions and 3 deletions
@@ -100,6 +100,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
TaskAnimationManager(Context ctx) {
mCtx = ctx;
}
SystemUiProxy getSystemUiProxy() {
return SystemUiProxy.INSTANCE.get(mCtx);
}
/**
* Preloads the recents animation.
*/
@@ -153,7 +158,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
final BaseContainerInterface containerInterface = gestureState.getContainerInterface();
mLastGestureState = gestureState;
RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks(
SystemUiProxy.INSTANCE.get(mCtx), containerInterface.allowMinimizeSplitScreen());
getSystemUiProxy(), containerInterface.allowMinimizeSplitScreen());
mCallbacks = newCallbacks;
mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() {
@Override
@@ -260,7 +265,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
}
RemoteAnimationTarget[] nonAppTargets = ENABLE_SHELL_TRANSITIONS
? null : SystemUiProxy.INSTANCE.get(mCtx).onStartingSplitLegacy(
? null : getSystemUiProxy().onStartingSplitLegacy(
appearedTaskTargets);
if (nonAppTargets == null) {
nonAppTargets = new RemoteAnimationTarget[0];
@@ -327,12 +332,13 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
if (ENABLE_SHELL_TRANSITIONS) {
final ActivityOptions options = ActivityOptions.makeBasic();
options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
// Use regular (non-transient) launch for all apps page to control IME.
if (!containerInterface.allowAllAppsFromOverview()) {
options.setTransientLaunch();
}
options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
mRecentsAnimationStartPending = SystemUiProxy.INSTANCE.get(mCtx)
mRecentsAnimationStartPending = getSystemUiProxy()
.startRecentsActivity(intent, options, mCallbacks);
if (enableHandleDelayedGestureCallbacks()) {
ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(