Loading services/core/java/com/android/server/wm/ActivityStarter.java +20 −0 Original line number Diff line number Diff line Loading @@ -414,6 +414,7 @@ class ActivityStarter { int filterCallingUid; PendingIntentRecord originatingPendingIntent; BackgroundStartPrivileges forcedBalByPiSender; boolean freezeScreen; final StringBuilder logMessage = new StringBuilder(); Loading Loading @@ -477,6 +478,7 @@ class ActivityStarter { filterCallingUid = UserHandle.USER_NULL; originatingPendingIntent = null; forcedBalByPiSender = BackgroundStartPrivileges.NONE; freezeScreen = false; errorCallbackToken = null; } Loading Loading @@ -520,6 +522,7 @@ class ActivityStarter { filterCallingUid = request.filterCallingUid; originatingPendingIntent = request.originatingPendingIntent; forcedBalByPiSender = request.forcedBalByPiSender; freezeScreen = request.freezeScreen; errorCallbackToken = request.errorCallbackToken; } Loading Loading @@ -1525,6 +1528,18 @@ class ActivityStarter { Transition newTransition = transitionController.isShellTransitionsEnabled() ? transitionController.createAndStartCollecting(TRANSIT_OPEN) : null; RemoteTransition remoteTransition = r.takeRemoteTransition(); // Create a display snapshot as soon as possible. if (newTransition != null && mRequest.freezeScreen) { final TaskDisplayArea tda = mLaunchParams.hasPreferredTaskDisplayArea() ? mLaunchParams.mPreferredTaskDisplayArea : mRootWindowContainer.getDefaultTaskDisplayArea(); final DisplayContent dc = mRootWindowContainer.getDisplayContentOrCreate( tda.getDisplayId()); if (dc != null) { transitionController.collect(dc); transitionController.collectVisibleChange(dc); } } try { mService.deferWindowLayout(); transitionController.collect(r); Loading Loading @@ -3270,6 +3285,11 @@ class ActivityStarter { return this; } ActivityStarter setFreezeScreen(boolean freezeScreen) { mRequest.freezeScreen = freezeScreen; return this; } ActivityStarter setErrorCallbackToken(@Nullable IBinder errorCallbackToken) { mRequest.errorCallbackToken = errorCallbackToken; return this; Loading services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,19 @@ public abstract class ActivityTaskManagerInternal { @Nullable String callingFeatureId, Intent intent, @Nullable IBinder resultTo, int startFlags, @Nullable Bundle options, int userId); /** * Start activity {@code intent} with initially under screenshot. The screen of launching * display will be frozen before transition occur. * * - DO NOT call it with the calling UID cleared. * - The caller must do the calling user ID check. * * @return error codes used by {@link IActivityManager#startActivity} and its siblings. */ public abstract int startActivityWithScreenshot(@NonNull Intent intent, @NonNull String callingPackage, int callingUid, int callingPid, @Nullable IBinder resultTo, @Nullable Bundle options, int userId); /** * Called after virtual display Id is updated by * {@link com.android.server.vr.Vr2dDisplay} with a specific Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +18 −0 Original line number Diff line number Diff line Loading @@ -6014,6 +6014,24 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { false /*validateIncomingUser*/); } @Override public int startActivityWithScreenshot(@NonNull Intent intent, @NonNull String callingPackage, int callingUid, int callingPid, @Nullable IBinder resultTo, @Nullable Bundle options, int userId) { return getActivityStartController() .obtainStarter(intent, "startActivityWithScreenshot") .setCallingUid(callingUid) .setCallingPid(callingPid) .setCallingPackage(callingPackage) .setResultTo(resultTo) .setActivityOptions(createSafeActivityOptionsWithBalAllowed(options)) .setRealCallingUid(Binder.getCallingUid()) .setUserId(userId) .setBackgroundStartPrivileges(BackgroundStartPrivileges.ALLOW_BAL) .setFreezeScreen(true) .execute(); } /** * Called after virtual display Id is updated by * {@link com.android.server.vr.Vr2dDisplay} with a specific Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +20 −0 Original line number Diff line number Diff line Loading @@ -414,6 +414,7 @@ class ActivityStarter { int filterCallingUid; PendingIntentRecord originatingPendingIntent; BackgroundStartPrivileges forcedBalByPiSender; boolean freezeScreen; final StringBuilder logMessage = new StringBuilder(); Loading Loading @@ -477,6 +478,7 @@ class ActivityStarter { filterCallingUid = UserHandle.USER_NULL; originatingPendingIntent = null; forcedBalByPiSender = BackgroundStartPrivileges.NONE; freezeScreen = false; errorCallbackToken = null; } Loading Loading @@ -520,6 +522,7 @@ class ActivityStarter { filterCallingUid = request.filterCallingUid; originatingPendingIntent = request.originatingPendingIntent; forcedBalByPiSender = request.forcedBalByPiSender; freezeScreen = request.freezeScreen; errorCallbackToken = request.errorCallbackToken; } Loading Loading @@ -1525,6 +1528,18 @@ class ActivityStarter { Transition newTransition = transitionController.isShellTransitionsEnabled() ? transitionController.createAndStartCollecting(TRANSIT_OPEN) : null; RemoteTransition remoteTransition = r.takeRemoteTransition(); // Create a display snapshot as soon as possible. if (newTransition != null && mRequest.freezeScreen) { final TaskDisplayArea tda = mLaunchParams.hasPreferredTaskDisplayArea() ? mLaunchParams.mPreferredTaskDisplayArea : mRootWindowContainer.getDefaultTaskDisplayArea(); final DisplayContent dc = mRootWindowContainer.getDisplayContentOrCreate( tda.getDisplayId()); if (dc != null) { transitionController.collect(dc); transitionController.collectVisibleChange(dc); } } try { mService.deferWindowLayout(); transitionController.collect(r); Loading Loading @@ -3270,6 +3285,11 @@ class ActivityStarter { return this; } ActivityStarter setFreezeScreen(boolean freezeScreen) { mRequest.freezeScreen = freezeScreen; return this; } ActivityStarter setErrorCallbackToken(@Nullable IBinder errorCallbackToken) { mRequest.errorCallbackToken = errorCallbackToken; return this; Loading
services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,19 @@ public abstract class ActivityTaskManagerInternal { @Nullable String callingFeatureId, Intent intent, @Nullable IBinder resultTo, int startFlags, @Nullable Bundle options, int userId); /** * Start activity {@code intent} with initially under screenshot. The screen of launching * display will be frozen before transition occur. * * - DO NOT call it with the calling UID cleared. * - The caller must do the calling user ID check. * * @return error codes used by {@link IActivityManager#startActivity} and its siblings. */ public abstract int startActivityWithScreenshot(@NonNull Intent intent, @NonNull String callingPackage, int callingUid, int callingPid, @Nullable IBinder resultTo, @Nullable Bundle options, int userId); /** * Called after virtual display Id is updated by * {@link com.android.server.vr.Vr2dDisplay} with a specific Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +18 −0 Original line number Diff line number Diff line Loading @@ -6014,6 +6014,24 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { false /*validateIncomingUser*/); } @Override public int startActivityWithScreenshot(@NonNull Intent intent, @NonNull String callingPackage, int callingUid, int callingPid, @Nullable IBinder resultTo, @Nullable Bundle options, int userId) { return getActivityStartController() .obtainStarter(intent, "startActivityWithScreenshot") .setCallingUid(callingUid) .setCallingPid(callingPid) .setCallingPackage(callingPackage) .setResultTo(resultTo) .setActivityOptions(createSafeActivityOptionsWithBalAllowed(options)) .setRealCallingUid(Binder.getCallingUid()) .setUserId(userId) .setBackgroundStartPrivileges(BackgroundStartPrivileges.ALLOW_BAL) .setFreezeScreen(true) .execute(); } /** * Called after virtual display Id is updated by * {@link com.android.server.vr.Vr2dDisplay} with a specific Loading