Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5dd8be7 authored by Evan Rosky's avatar Evan Rosky Committed by Android Build Coastguard Worker
Browse files

Strip transition information from activityoptions when sent to app

The implementation of shared-element transitions takes the
ActivityOptions from the calling activity and sends them to
another activity. This means that any sensitive information
passed into ActivityManager via ActivityOptions can make its
way to an unrelated app. Recently a RemoteTransition object
was added which includes some sensitive information.

This CL strips the sensitive information from the activity
options before sending it to anonther app.

Bug: 237290578
Test: atest ActivityManagerTest#testActivityManager_stripTransitionFromActivityOptions
Change-Id: Ifa08fc195698f02bf70ca386178c67f6ba4a14ea
(cherry picked from commit 0d03e6f1)
Merged-In: Ifa08fc195698f02bf70ca386178c67f6ba4a14ea
parent 9194bce0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1441,6 +1441,11 @@ public class ActivityOptions extends ComponentOptions {
        return mRemoteTransition;
    }

    /** @hide */
    public void setRemoteTransition(@Nullable RemoteTransition remoteTransition) {
        mRemoteTransition = remoteTransition;
    }

    /** @hide */
    public static ActivityOptions fromBundle(Bundle bOptions) {
        return bOptions != null ? new ActivityOptions(bOptions) : null;
+4 −0
Original line number Diff line number Diff line
@@ -4884,8 +4884,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    ActivityOptions takeOptions() {
        if (DEBUG_TRANSITION) Slog.i(TAG, "Taking options for " + this + " callers="
                + Debug.getCallers(6));
        if (mPendingOptions == null) return null;
        final ActivityOptions opts = mPendingOptions;
        mPendingOptions = null;
        // Strip sensitive information from options before sending it to app.
        opts.setRemoteTransition(null);
        opts.setRemoteAnimationAdapter(null);
        return opts;
    }