From c17d7e0d6470e1141314c00e4a1ea66cf21643af Mon Sep 17 00:00:00 2001 From: Alexandra Gherghina Date: Fri, 4 Apr 2014 16:27:28 +0100 Subject: [PATCH] Introduces intents for adding and removing a managed profile. Change-Id: I6b8b7a314ea52bfd0c750da94066156e73a0f2f5 --- api/current.txt | 3 +++ core/java/android/content/Intent.java | 31 ++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index a543cbf6f669a..2697df6acb580 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6836,6 +6836,8 @@ package android.content { field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; field public static final java.lang.String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED"; field public static final java.lang.String ACTION_MAIN = "android.intent.action.MAIN"; + field public static final java.lang.String ACTION_MANAGED_PROFILE_ADDED = "android.intent.action.MANAGED_PROFILE_ADDED"; + field public static final java.lang.String ACTION_MANAGED_PROFILE_REMOVED = "android.intent.action.MANAGED_PROFILE_REMOVED"; field public static final java.lang.String ACTION_MANAGE_NETWORK_USAGE = "android.intent.action.MANAGE_NETWORK_USAGE"; field public static final java.lang.String ACTION_MANAGE_PACKAGE_STORAGE = "android.intent.action.MANAGE_PACKAGE_STORAGE"; field public static final java.lang.String ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.MEDIA_BAD_REMOVAL"; @@ -6985,6 +6987,7 @@ package android.content { field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT"; field public static final java.lang.String EXTRA_TITLE = "android.intent.extra.TITLE"; field public static final java.lang.String EXTRA_UID = "android.intent.extra.UID"; + field public static final java.lang.String EXTRA_USER = "android.intent.extra.user"; field public static final int FILL_IN_ACTION = 1; // 0x1 field public static final int FILL_IN_CATEGORIES = 4; // 0x4 field public static final int FILL_IN_CLIP_DATA = 128; // 0x80 diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index d189a344fdbd9..9881428865c4e 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2607,6 +2607,23 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_USER_INFO_CHANGED = "android.intent.action.USER_INFO_CHANGED"; + /** + * Broadcast sent to the primary user when an associated managed profile is added (the profile + * was created and is ready to be used). Carries an extra {@link #EXTRA_USER} that specifies + * the UserHandle of the profile that was added. This is only sent to registered receivers, + * not manifest receivers. + */ + public static final String ACTION_MANAGED_PROFILE_ADDED = + "android.intent.action.MANAGED_PROFILE_ADDED"; + + /** + * Broadcast sent to the primary user when an associated managed profile is removed. Carries an + * extra {@link #EXTRA_USER} that specifies the UserHandle of the profile that was removed. This + * is only sent to registered receivers, not manifest receivers. + */ + public static final String ACTION_MANAGED_PROFILE_REMOVED = + "android.intent.action.MANAGED_PROFILE_REMOVED"; + /** * Sent when the user taps on the clock widget in the system's "quick settings" area. */ @@ -3301,14 +3318,22 @@ public class Intent implements Parcelable, Cloneable { "android.intent.extra.ALLOW_MULTIPLE"; /** - * The userHandle carried with broadcast intents related to addition, removal and switching of - * users - * - {@link #ACTION_USER_ADDED}, {@link #ACTION_USER_REMOVED} and {@link #ACTION_USER_SWITCHED}. + * The integer userHandle carried with broadcast intents related to addition, removal and + * switching of users and managed profiles - {@link #ACTION_USER_ADDED}, + * {@link #ACTION_USER_REMOVED} and {@link #ACTION_USER_SWITCHED}. + * * @hide */ public static final String EXTRA_USER_HANDLE = "android.intent.extra.user_handle"; + /** + * The UserHandle carried with broadcasts intents related to addition and removal of managed + * profiles - {@link #ACTION_MANAGED_PROFILE_ADDED} and {@link #ACTION_MANAGED_PROFILE_REMOVED}. + */ + public static final String EXTRA_USER = + "android.intent.extra.user"; + /** * Extra used in the response from a BroadcastReceiver that handles * {@link #ACTION_GET_RESTRICTION_ENTRIES}. The type of the extra is