summaryrefslogtreecommitdiff
path: root/core/java/android/content/Intent.java
diff options
context:
space:
mode:
authorJackal Guo <jackalguo@google.com>2021-03-25 13:50:15 +0800
committerJackal Guo <jackalguo@google.com>2021-04-21 09:48:40 +0800
commita3e316fb0153cb4d4cf4f154e0bb85a9a543d6a5 (patch)
tree4f80f8f1fdafdb4098c4efa11b53a9d805b9d797 /core/java/android/content/Intent.java
parentb0ea152982c5499b7c4c0e7c70b2a552e4a2cc32 (diff)
Apply package visibility to LauncherApps.Callback
Applications could know package related events via registering and implementing the LaunchersApps.Callback. We should also apply the visibility to LauncherApps.Callback like what we did for Broadcast- Receiver. For removed one, using a new protected broadcast with the visibility allow list in the extra instead since the PackageSetting is already deleted and wouldn't be able to get its visibility allow list. Bug: 143946569 Test: atest AppEnumerationTests Test: atest ShortcutManagerLauncherCallbackTest Test: atest IncrementalLoadingProgressTest Test: atest NonIncrementalLoadingProgressTest Change-Id: If457e2d7892d9d4fbb8cf0ca230de423526eeb10
Diffstat (limited to 'core/java/android/content/Intent.java')
-rw-r--r--core/java/android/content/Intent.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 71cd6f1ec49c..39933a9ee7b4 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2569,6 +2569,32 @@ public class Intent implements Parcelable, Cloneable {
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED";
/**
+ * Broadcast Action: An existing application package has been removed from
+ * the device. The data contains the name of the package and the visibility
+ * allow list. The package that is being removed does <em>not</em> receive
+ * this Intent.
+ * <ul>
+ * <li> {@link #EXTRA_UID} containing the integer uid previously assigned
+ * to the package.
+ * <li> {@link #EXTRA_DATA_REMOVED} is set to true if the entire
+ * 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_USER_INITIATED} containing boolean field to signal
+ * that the application was removed with the user-initiated action.
+ * <li> {@link #EXTRA_VISIBILITY_ALLOW_LIST} containing an int array to
+ * indicate the visibility allow list.
+ * </ul>
+ *
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ *
+ * @hide This broadcast is used internally by the system.
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_PACKAGE_REMOVED_INTERNAL =
+ "android.intent.action.PACKAGE_REMOVED_INTERNAL";
+ /**
* Broadcast Action: An existing application package has been completely
* removed from the device. The data contains the name of the package.
* This is like {@link #ACTION_PACKAGE_REMOVED}, but only set when
@@ -6122,6 +6148,16 @@ public class Intent implements Parcelable, Cloneable {
*/
public static final String EXTRA_LOCUS_ID = "android.intent.extra.LOCUS_ID";
+ /**
+ * Used as an int array extra field in
+ * {@link android.content.Intent#ACTION_PACKAGE_REMOVED_INTERNAL}
+ * intents to indicate that visibility allow list of this removed package.
+ *
+ * @hide
+ */
+ public static final String EXTRA_VISIBILITY_ALLOW_LIST =
+ "android.intent.extra.VISIBILITY_ALLOW_LIST";
+
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Intent flags (see mFlags variable).