diff options
| author | Todd Kennedy <toddke@google.com> | 2019-01-04 14:41:03 -0800 |
|---|---|---|
| committer | Rhed Jao <rhedjao@google.com> | 2020-10-06 14:09:36 +0800 |
| commit | acbe943d64dfef9f60411a15c690ddcf4bb74255 (patch) | |
| tree | e150ee51dc7014238301c33d7e7938660e3e554f /core/java/android/content/Intent.java | |
| parent | e1505c795968fc73f6f5cb1c360fb4a5e280a286 (diff) | |
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
Diffstat (limited to 'core/java/android/content/Intent.java')
| -rw-r--r-- | core/java/android/content/Intent.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 9a9f165030b0..2f1254f90ccf 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -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 @@ -5557,6 +5560,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 * number to call in a {@link android.content.Intent#ACTION_CALL}. |
