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

Commit 68943ec4 authored by Ashwini Oruganti's avatar Ashwini Oruganti Committed by Automerger Merge Worker
Browse files

Merge "Enforce the PI mutability flag requirement for test apps" into sc-dev am: aeb5dbf1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14164166

Change-Id: I7929e5b76d8b58e52d92b4ab810113d5a3efbcf7
parents 77f58daa aeb5dbf1
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.util.AndroidException;
import android.util.ArraySet;
import android.util.Log;
import android.util.proto.ProtoOutputStream;

import com.android.internal.os.IResultReceiver;
@@ -371,21 +370,11 @@ public final class PendingIntent implements Parcelable {
                "Cannot set both FLAG_IMMUTABLE and FLAG_MUTABLE for PendingIntent");
        }

        // TODO(b/178092897) Remove the below instrumentation check and enforce
        // the explicit mutability requirement for apps under instrumentation.
        ActivityThread thread = ActivityThread.currentActivityThread();
        Instrumentation mInstrumentation = thread.getInstrumentation();

        if (Compatibility.isChangeEnabled(PENDING_INTENT_EXPLICIT_MUTABILITY_REQUIRED)
                && !flagImmutableSet && !flagMutableSet) {

            if (mInstrumentation.isInstrumenting()) {
                Log.e(TAG, msg);
            } else {
                throw new IllegalArgumentException(msg);
        }
    }
    }

    /**
     * Retrieve a PendingIntent that will start a new activity, like calling