Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5789,6 +5789,7 @@ package android.app.admin { method public void clearCrossProfileIntentFilters(android.content.ComponentName); method public void clearDeviceOwnerApp(java.lang.String); method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String); method public void clearProfileOwner(android.content.ComponentName); method public void clearUserRestriction(android.content.ComponentName, java.lang.String); method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle); method public android.os.UserHandle createAndManageUser(android.content.ComponentName, java.lang.String, android.content.ComponentName, android.os.PersistableBundle, int); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5791,6 +5791,7 @@ package android.app.admin { method public void clearCrossProfileIntentFilters(android.content.ComponentName); method public void clearDeviceOwnerApp(java.lang.String); method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String); method public void clearProfileOwner(android.content.ComponentName); method public void clearUserRestriction(android.content.ComponentName, java.lang.String); method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle); method public android.os.UserHandle createAndManageUser(android.content.ComponentName, java.lang.String, android.content.ComponentName, android.os.PersistableBundle, int); core/java/android/app/admin/DevicePolicyManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -3244,15 +3244,14 @@ public class DevicePolicyManager { } /** * @hide * Clears the active profile owner and removes all user restrictions. The caller must * be from the same package as the active profile owner for this user, otherwise a * SecurityException will be thrown. * * <p>This doesn't work for managed profile owners. * * @param admin The component to remove as the profile owner. * @return */ @SystemApi public void clearProfileOwner(@NonNull ComponentName admin) { if (mService != null) { try { Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -5423,7 +5423,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!mHasFeature) { return; } UserHandle callingUser = mInjector.binderGetCallingUserHandle(); final UserHandle callingUser = mInjector.binderGetCallingUserHandle(); final int userId = callingUser.getIdentifier(); enforceNotManagedProfile(userId, "clear profile owner"); // Check if this is the profile owner who is calling final ActiveAdmin admin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); Loading @@ -5431,7 +5433,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { admin.disableCamera = false; admin.userRestrictions = null; clearUserPoliciesLocked(callingUser); final int userId = callingUser.getIdentifier(); mOwners.removeProfileOwner(userId); mOwners.writeProfileOwner(userId); } Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5789,6 +5789,7 @@ package android.app.admin { method public void clearCrossProfileIntentFilters(android.content.ComponentName); method public void clearDeviceOwnerApp(java.lang.String); method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String); method public void clearProfileOwner(android.content.ComponentName); method public void clearUserRestriction(android.content.ComponentName, java.lang.String); method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle); method public android.os.UserHandle createAndManageUser(android.content.ComponentName, java.lang.String, android.content.ComponentName, android.os.PersistableBundle, int);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -5791,6 +5791,7 @@ package android.app.admin { method public void clearCrossProfileIntentFilters(android.content.ComponentName); method public void clearDeviceOwnerApp(java.lang.String); method public void clearPackagePersistentPreferredActivities(android.content.ComponentName, java.lang.String); method public void clearProfileOwner(android.content.ComponentName); method public void clearUserRestriction(android.content.ComponentName, java.lang.String); method public deprecated android.os.UserHandle createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle); method public android.os.UserHandle createAndManageUser(android.content.ComponentName, java.lang.String, android.content.ComponentName, android.os.PersistableBundle, int);
core/java/android/app/admin/DevicePolicyManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -3244,15 +3244,14 @@ public class DevicePolicyManager { } /** * @hide * Clears the active profile owner and removes all user restrictions. The caller must * be from the same package as the active profile owner for this user, otherwise a * SecurityException will be thrown. * * <p>This doesn't work for managed profile owners. * * @param admin The component to remove as the profile owner. * @return */ @SystemApi public void clearProfileOwner(@NonNull ComponentName admin) { if (mService != null) { try { Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -5423,7 +5423,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!mHasFeature) { return; } UserHandle callingUser = mInjector.binderGetCallingUserHandle(); final UserHandle callingUser = mInjector.binderGetCallingUserHandle(); final int userId = callingUser.getIdentifier(); enforceNotManagedProfile(userId, "clear profile owner"); // Check if this is the profile owner who is calling final ActiveAdmin admin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); Loading @@ -5431,7 +5433,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { admin.disableCamera = false; admin.userRestrictions = null; clearUserPoliciesLocked(callingUser); final int userId = callingUser.getIdentifier(); mOwners.removeProfileOwner(userId); mOwners.writeProfileOwner(userId); } Loading