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

Commit acbe943d authored by Todd Kennedy's avatar Todd Kennedy Committed by Rhed Jao
Browse files

Send extra when automatically removing packages (1/2)

Introduce a new extra field for ACTION_PACKAGE_REMOVED intent to
signal that the application was removed automatically without the
user-initiated action.

If the system automatically prunes a package [eg. an instant app], we
mark the broadcast with that information. Launchers or other applications
can use this information to potentially alter their behaviour.

Bug: 111318529
Test: atest CtsAppSecurityHostTestCases:EphemeralTest
Change-Id: I3a4690d7df6e2dce10b246fe20a627ba2eed5da0
parent e1505c79
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10804,6 +10804,7 @@ package android.content {
    field public static final String EXTRA_REFERRER = "android.intent.extra.REFERRER";
    field public static final String EXTRA_REFERRER_NAME = "android.intent.extra.REFERRER_NAME";
    field public static final String EXTRA_REMOTE_INTENT_TOKEN = "android.intent.extra.remote_intent_token";
    field public static final String EXTRA_REMOVED_BY_SYSTEM = "android.intent.extra.REMOVED_BY_SYSTEM";
    field public static final String EXTRA_REPLACEMENT_EXTRAS = "android.intent.extra.REPLACEMENT_EXTRAS";
    field public static final String EXTRA_REPLACING = "android.intent.extra.REPLACING";
    field public static final String EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.restrictions_bundle";
+11 −0
Original line number Diff line number Diff line
@@ -620,6 +620,7 @@ import java.util.TimeZone;
 *     <li> {@link #EXTRA_PHONE_NUMBER}
 *     <li> {@link #EXTRA_REFERRER}
 *     <li> {@link #EXTRA_REMOTE_INTENT_TOKEN}
 *     <li> {@link #EXTRA_REMOVED_BY_SYSTEM}
 *     <li> {@link #EXTRA_REPLACING}
 *     <li> {@link #EXTRA_SHORTCUT_ICON}
 *     <li> {@link #EXTRA_SHORTCUT_ICON_RESOURCE}
@@ -2464,6 +2465,8 @@ public class Intent implements Parcelable, Cloneable {
     * application -- data and code -- is being removed.
     * <li> {@link #EXTRA_REPLACING} is set to true if this will be followed
     * by an {@link #ACTION_PACKAGE_ADDED} broadcast for the same package.
     * <li> {@link #EXTRA_REMOVED_BY_SYSTEM} containing boolean field to to signal that the
     * application was removed automatically without the user-initiated action.
     * </ul>
     *
     * <p class="note">This is a protected intent that can only be sent
@@ -5556,6 +5559,14 @@ public class Intent implements Parcelable, Cloneable {
     */
    public static final String EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP";

    /**
     * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED}
     * intents to signal that the application was removed automatically without the user-initiated
     * action.
     */
    public static final String EXTRA_REMOVED_BY_SYSTEM =
            "android.intent.extra.REMOVED_BY_SYSTEM";

    /**
     * A String holding the phone number originally entered in
     * {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL}, or the actual
+1 −0
Original line number Diff line number Diff line
@@ -10804,6 +10804,7 @@ package android.content {
    field public static final String EXTRA_REFERRER = "android.intent.extra.REFERRER";
    field public static final String EXTRA_REFERRER_NAME = "android.intent.extra.REFERRER_NAME";
    field public static final String EXTRA_REMOTE_INTENT_TOKEN = "android.intent.extra.remote_intent_token";
    field public static final String EXTRA_REMOVED_BY_SYSTEM = "android.intent.extra.REMOVED_BY_SYSTEM";
    field public static final String EXTRA_REPLACEMENT_EXTRAS = "android.intent.extra.REPLACEMENT_EXTRAS";
    field public static final String EXTRA_REPLACING = "android.intent.extra.REPLACING";
    field public static final String EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.restrictions_bundle";