From 86a72dacbea3331cd5423c1f2f6ecbfae535e57c Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 11 Nov 2009 20:12:41 -0800 Subject: Fix issue #2256270: Package manager sends bad broadcasts when components change Also reworks this intent protocol a little bit to be much more efficient, only requiring one broadcast per package. Change-Id: I580de4843ebd3c7f2e6df7295a2f80d2937cef7c --- core/java/android/content/Intent.java | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'core/java/android/content/Intent.java') diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index c676a5b..398f211 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1275,12 +1275,15 @@ public class Intent implements Parcelable { @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 changed (e.g. a component has been - * enabled or disabled. The data contains the name of the package. + * Broadcast Action: An existing application package has been changed (e.g. + * a component has been enabled or disabled). The data contains the name of + * the package. * * *

This is a protected intent that can only be sent @@ -2101,14 +2104,20 @@ public class Intent implements Parcelable { "android.intent.extra.remote_intent_token"; /** - * Used as an int extra field in {@link android.content.Intent#ACTION_PACKAGE_CHANGED} - * intent to supply the name of the component that changed. - * + * @Deprecated See {@link #EXTRA_CHANGED_COMPONENT_NAME_LIST}; this field + * will contain only the first name in the list. */ public static final String EXTRA_CHANGED_COMPONENT_NAME = "android.intent.extra.changed_component_name"; /** + * This field is part of {@link android.content.Intent#ACTION_PACKAGE_CHANGED} + * and contains a string array of all of the components that have changed. + */ + public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST = + "android.intent.extra.changed_component_name_list"; + + /** * @hide * Magic extra system code can use when binding, to give a label for * who it is that has bound to a service. This is an integer giving -- cgit v1.1