Merge "Strip transition information from activityoptions when sent to app" into sc-v2-dev

This commit is contained in:
Evan Rosky
2022-08-04 04:30:29 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -1352,6 +1352,11 @@ public class ActivityOptions {
return mRemoteTransition; return mRemoteTransition;
} }
/** @hide */
public void setRemoteTransition(@Nullable RemoteTransition remoteTransition) {
mRemoteTransition = remoteTransition;
}
/** @hide */ /** @hide */
public static ActivityOptions fromBundle(Bundle bOptions) { public static ActivityOptions fromBundle(Bundle bOptions) {
return bOptions != null ? new ActivityOptions(bOptions) : null; return bOptions != null ? new ActivityOptions(bOptions) : null;

View File

@@ -4640,8 +4640,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
ActivityOptions takeOptions() { ActivityOptions takeOptions() {
if (DEBUG_TRANSITION) Slog.i(TAG, "Taking options for " + this + " callers=" if (DEBUG_TRANSITION) Slog.i(TAG, "Taking options for " + this + " callers="
+ Debug.getCallers(6)); + Debug.getCallers(6));
if (mPendingOptions == null) return null;
final ActivityOptions opts = mPendingOptions; final ActivityOptions opts = mPendingOptions;
mPendingOptions = null; mPendingOptions = null;
// Strip sensitive information from options before sending it to app.
opts.setRemoteTransition(null);
opts.setRemoteAnimationAdapter(null);
return opts; return opts;
} }