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

Commit b34540fe authored by Nan Wu's avatar Nan Wu Committed by Android (Google) Code Review
Browse files

Merge "Add new API to allow app to opt out Intent Redirect Prevention" into main

parents f0b2e92d b7815a0a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11240,6 +11240,7 @@ package android.content {
    method public void removeCategory(String);
    method public void removeExtra(String);
    method public void removeFlags(int);
    method @FlaggedApi("android.security.prevent_intent_redirect") public void removeLaunchSecurityProtection();
    method @NonNull public android.content.Intent replaceExtras(@NonNull android.content.Intent);
    method @NonNull public android.content.Intent replaceExtras(@Nullable android.os.Bundle);
    method public android.content.ComponentName resolveActivity(@NonNull android.content.pm.PackageManager);
+15 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.app.sdksandbox.SdkSandboxManager.ACTION_START_SANDBOXED_AC
import static android.content.ContentProvider.maybeAddUserId;
import static android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE;
import static android.security.Flags.FLAG_FRP_ENFORCEMENT;
import static android.security.Flags.FLAG_PREVENT_INTENT_REDIRECT;
import static android.security.Flags.preventIntentRedirect;
import android.Manifest;
@@ -12297,6 +12298,20 @@ public class Intent implements Parcelable, Cloneable {
        mExtras.setIsIntentExtra();
    }
    /**
     * When an intent comes from another app or component as an embedded extra intent, the system
     * creates a token to identify the creator of this foreign intent. If this token is missing or
     * invalid, the system will block the launch of this intent. If it contains a valid token, the
     * system will perform verification against the creator to block launching target it has no
     * permission to launch or block it from granting URI access to the tagert it cannot access.
     * This method provides a way to opt out this feature.
     */
    @FlaggedApi(FLAG_PREVENT_INTENT_REDIRECT)
    public void removeLaunchSecurityProtection() {
        mExtendedFlags &= ~EXTENDED_FLAG_MISSING_CREATOR_OR_INVALID_TOKEN;
        removeCreatorTokenInfo();
    }
    public void writeToParcel(Parcel out, int flags) {
        out.writeString8(mAction);
        Uri.writeToParcel(out, mData);