From ffa3840cf32cc3d02fc8d7a0f7b445dd9015b1a6 Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Thu, 31 Mar 2016 16:40:57 +0100 Subject: [PATCH] Allow PO to check if it is in a managed profile. Method was @hide because we only intended to add managed users in a later release, however we added createAndManageUser which allows it. Bug: 27261765 Change-Id: I029f8ef35a3065f7fc598b5f854c8d8cdc9c555d --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + core/java/android/app/admin/DevicePolicyManager.java | 3 +-- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index c81284b1af465..c97573de59bbc 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5900,6 +5900,7 @@ package android.app.admin { method public boolean isCallerApplicationRestrictionsManagingPackage(); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isLockTaskPermitted(java.lang.String); + method public boolean isManagedProfile(android.content.ComponentName); method public boolean isMasterVolumeMuted(android.content.ComponentName); method public boolean isProfileOwnerApp(java.lang.String); method public boolean isProvisioningAllowed(java.lang.String); diff --git a/api/system-current.txt b/api/system-current.txt index 071d1f123ebe3..dec80c89597f1 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6046,6 +6046,7 @@ package android.app.admin { method public boolean isCallerApplicationRestrictionsManagingPackage(); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isLockTaskPermitted(java.lang.String); + method public boolean isManagedProfile(android.content.ComponentName); method public boolean isMasterVolumeMuted(android.content.ComponentName); method public boolean isProfileOwnerApp(java.lang.String); method public boolean isProvisioningAllowed(java.lang.String); diff --git a/api/test-current.txt b/api/test-current.txt index 821614631d65e..8fa75e0c30de4 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -5904,6 +5904,7 @@ package android.app.admin { method public boolean isCallerApplicationRestrictionsManagingPackage(); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isLockTaskPermitted(java.lang.String); + method public boolean isManagedProfile(android.content.ComponentName); method public boolean isMasterVolumeMuted(android.content.ComponentName); method public boolean isProfileOwnerApp(java.lang.String); method public boolean isProvisioningAllowed(java.lang.String); diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index e1afb1743843e..9cf431ed06afd 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -5588,10 +5588,9 @@ public class DevicePolicyManager { } /** - * @hide * Return if this user is a managed profile of another user. An admin can become the profile * owner of a managed profile with {@link #ACTION_PROVISION_MANAGED_PROFILE} and of a managed - * user with {@link #ACTION_PROVISION_MANAGED_USER}. + * user with {@link #createAndManageUser} * @param admin Which profile owner this request is associated with. * @return if this user is a managed profile of another user. */