From c992109885e37e9dfa637cdd6a54db58050488eb Mon Sep 17 00:00:00 2001 From: Benjamin Franz Date: Fri, 8 Jan 2016 17:17:44 +0000 Subject: [PATCH] Introduce new intent action to set parent challenge Introduce a new intent action that triggers setting of the challenge of the parent user. The existing intent action is repurposed to always trigger setting the challenge of the calling user. Change-Id: Ia7afe268b2de95537bed5bbb57163fd23bb55b6a --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + .../android/app/admin/DevicePolicyManager.java | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) diff --git a/api/current.txt b/api/current.txt index 358d4d5176f77..c10aecd0efb4d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5902,6 +5902,7 @@ package android.app.admin { field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED"; field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE"; + field public static final java.lang.String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD"; field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED"; diff --git a/api/system-current.txt b/api/system-current.txt index 9b66945ecbc91..a4e822e0dce65 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6045,6 +6045,7 @@ package android.app.admin { field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED"; field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE"; + field public static final java.lang.String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD"; field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; field public static final java.lang.String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER"; field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; diff --git a/api/test-current.txt b/api/test-current.txt index 41a77b3c8a92d..6074ad4c51ba2 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -5904,6 +5904,7 @@ package android.app.admin { field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED"; field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE"; + field public static final java.lang.String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD"; field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED"; diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index c7f11e2fe6d26..45b23d0d16093 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -773,11 +773,27 @@ public class DevicePolicyManager { * have the user select a new password in order to meet the current * constraints. Upon being resumed from this activity, you can check the new * password characteristics to see if they are sufficient. + * + * If the intent is launched from within a managed profile with a profile + * owner built against {@link android.os.Build.VERSION_CODES#M} or before, + * this will trigger entering a new password for the parent of the profile. + * For all other cases it will trigger entering a new password for the user + * or profile it is launched from. */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; + /** + * Activity action: have the user enter a new password for the parent profile. + * If the intent is launched from within a managed profile, this will trigger + * entering a new password for the parent of the profile. In all other cases + * the behaviour is identical to {@link #ACTION_SET_NEW_PASSWORD}. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD + = "android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD"; + /** * Flag used by {@link #addCrossProfileIntentFilter} to allow activities in * the parent profile to access intents sent from the managed profile.