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

Commit 57d6b760 authored by Hao Ke's avatar Hao Ke Committed by Android (Google) Code Review
Browse files

Merge "Remove CompatChange ID for ENABLE_PREVENT_INTENT_REDIRECT" into main

parents 7c8aece1 5a4d312f
Loading
Loading
Loading
Loading
+3 −20
Original line number Diff line number Diff line
@@ -41,10 +41,7 @@ import android.app.Activity;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.StatusBarManager;
import android.app.compat.CompatChanges;
import android.bluetooth.BluetoothDevice;
import android.compat.annotation.ChangeId;
import android.compat.annotation.Overridable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -673,12 +670,6 @@ import java.util.TimeZone;
@android.ravenwood.annotation.RavenwoodKeepWholeClass
public class Intent implements Parcelable, Cloneable {
    private static final String TAG = "Intent";
    /** @hide */
    @ChangeId
    @Overridable
    public static final long ENABLE_PREVENT_INTENT_REDIRECT = 29076063L;
    private static final String ATTR_ACTION = "action";
    private static final String TAG_CATEGORIES = "categories";
    private static final String ATTR_CATEGORY = "category";
@@ -12255,7 +12246,7 @@ public class Intent implements Parcelable, Cloneable {
     * @hide
     */
    public void collectExtraIntentKeys() {
        if (!isPreventIntentRedirectEnabled()) return;
        if (!preventIntentRedirect()) return;
        if (mExtras != null && !mExtras.isEmpty()) {
            for (String key : mExtras.keySet()) {
@@ -12272,14 +12263,6 @@ public class Intent implements Parcelable, Cloneable {
        }
    }
    /**
     * @hide
     */
    public static boolean isPreventIntentRedirectEnabled() {
        return preventIntentRedirect() && CompatChanges.isChangeEnabled(
                ENABLE_PREVENT_INTENT_REDIRECT);
    }
    /** @hide */
    public void checkCreatorToken() {
        if (mExtras == null) return;
@@ -12368,7 +12351,7 @@ public class Intent implements Parcelable, Cloneable {
            out.writeInt(0);
        }
        if (isPreventIntentRedirectEnabled()) {
        if (preventIntentRedirect()) {
            if (mCreatorTokenInfo == null) {
                out.writeInt(0);
            } else {
@@ -12435,7 +12418,7 @@ public class Intent implements Parcelable, Cloneable {
            mOriginalIntent = new Intent(in);
        }
        if (isPreventIntentRedirectEnabled()) {
        if (preventIntentRedirect()) {
            if (in.readInt() != 0) {
                mCreatorTokenInfo = new CreatorTokenInfo();
                mCreatorTokenInfo.mCreatorToken = in.readStrongBinder();
+2 −2
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_BACKUP;
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_INSTRUMENTATION;
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_PERSISTENT;
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_SYSTEM;
import static android.content.Intent.isPreventIntentRedirectEnabled;
import static android.content.pm.ApplicationInfo.HIDDEN_API_ENFORCEMENT_DEFAULT;
import static android.content.pm.PackageManager.GET_SHARED_LIBRARY_FILES;
import static android.content.pm.PackageManager.MATCH_ALL;
@@ -131,6 +130,7 @@ import static android.os.Process.setThreadScheduler;
import static android.provider.Settings.Global.ALWAYS_FINISH_ACTIVITIES;
import static android.provider.Settings.Global.DEBUG_APP;
import static android.provider.Settings.Global.WAIT_FOR_DEBUGGER;
import static android.security.Flags.preventIntentRedirect;
import static android.util.FeatureFlagUtils.SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS;
import static android.view.Display.INVALID_DISPLAY;
@@ -19285,7 +19285,7 @@ public class ActivityManagerService extends IActivityManager.Stub
     * @hide
     */
    public void addCreatorToken(@Nullable Intent intent, String creatorPackage) {
        if (!isPreventIntentRedirectEnabled()) return;
        if (!preventIntentRedirect()) return;
        if (intent == null || intent.getExtraIntentKeys() == null) return;
        for (String key : intent.getExtraIntentKeys()) {