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

Commit f8c9fd78 authored by Nan Wu's avatar Nan Wu
Browse files

Fix check creator token

Add trunk stable flag guard for method call to mark intent as missing
or invalid creator token

Bug: 375073264
Test: Manual test
Flag: android.security.prevent_intent_redirect
Change-Id: I42089a204539d9cd32afab531ae573a8e2f5ee60
parent c6ad9c24
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -899,7 +899,7 @@ public class Intent implements Parcelable, Cloneable {
        boolean isForeign = (intent.mLocalFlags & LOCAL_FLAG_FROM_PARCEL) != 0;
        boolean isForeign = (intent.mLocalFlags & LOCAL_FLAG_FROM_PARCEL) != 0;
        boolean isWithoutTrustedCreatorToken =
        boolean isWithoutTrustedCreatorToken =
                (intent.mLocalFlags & Intent.LOCAL_FLAG_TRUSTED_CREATOR_TOKEN_PRESENT) == 0;
                (intent.mLocalFlags & Intent.LOCAL_FLAG_TRUSTED_CREATOR_TOKEN_PRESENT) == 0;
        if (isForeign && isWithoutTrustedCreatorToken) {
        if (isForeign && isWithoutTrustedCreatorToken && preventIntentRedirect()) {
            intent.addExtendedFlags(EXTENDED_FLAG_MISSING_CREATOR_OR_INVALID_TOKEN);
            intent.addExtendedFlags(EXTENDED_FLAG_MISSING_CREATOR_OR_INVALID_TOKEN);
        }
        }
    }
    }