Loading core/api/test-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -523,8 +523,8 @@ package android.app.admin { method @NonNull public static String operationToString(int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void resetDefaultCrossProfileIntentFilters(int); method @RequiresPermission(allOf={android.Manifest.permission.MANAGE_DEVICE_ADMINS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void setActiveAdmin(@NonNull android.content.ComponentName, boolean, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull android.content.ComponentName, @Nullable String, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly(@NonNull android.content.ComponentName, @Nullable String, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull android.content.ComponentName, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly(@NonNull android.content.ComponentName, int); method public void setDeviceOwnerType(@NonNull android.content.ComponentName, int); method @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_ADMINS) public void setNextOperationSafety(int, int); method @RequiresPermission(anyOf={android.Manifest.permission.MARK_DEVICE_ORGANIZATION_OWNED, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}, conditional=true) public void setProfileOwnerOnOrganizationOwnedDevice(@NonNull android.content.ComponentName, boolean); Loading core/java/android/app/admin/DevicePolicyManager.java +5 −7 Original line number Diff line number Diff line Loading @@ -8689,7 +8689,6 @@ public class DevicePolicyManager { * and no accounts. * * @param who the component name to be registered as device owner. * @param ownerName the human readable name of the institution that owns this device. * @param userId ID of the user on which the device owner runs. * * @return whether the package was successfully registered as the device owner. Loading @@ -8701,11 +8700,10 @@ public class DevicePolicyManager { */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull ComponentName who, @Nullable String ownerName, @UserIdInt int userId) { public boolean setDeviceOwner(@NonNull ComponentName who, @UserIdInt int userId) { if (mService != null) { try { return mService.setDeviceOwner(who, ownerName, userId, return mService.setDeviceOwner(who, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ true); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); Loading @@ -8715,7 +8713,7 @@ public class DevicePolicyManager { } /** * Same as {@link #setDeviceOwner(ComponentName, String, int)}, but without setting the profile * Same as {@link #setDeviceOwner(ComponentName, int)}, but without setting the profile * owner on current user when running on headless system user mode - should be used only by * testing infra. * Loading @@ -8724,10 +8722,10 @@ public class DevicePolicyManager { @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly( @NonNull ComponentName who, @Nullable String ownerName, @UserIdInt int userId) { @NonNull ComponentName who, @UserIdInt int userId) { if (mService != null) { try { return mService.setDeviceOwner(who, ownerName, userId, return mService.setDeviceOwner(who, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ false); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ interface IDevicePolicyManager { void reportKeyguardDismissed(int userHandle); void reportKeyguardSecured(int userHandle); boolean setDeviceOwner(in ComponentName who, String ownerName, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary); boolean setDeviceOwner(in ComponentName who, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary); ComponentName getDeviceOwnerComponent(boolean callingUserOnly); boolean hasDeviceOwner(); String getDeviceOwnerName(); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −8 Original line number Diff line number Diff line Loading @@ -8336,9 +8336,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + PackageManager.FEATURE_DEVICE_ADMIN + " feature."); } // TODO(b/240562946): Remove owner name from API parameters. @Override public boolean setDeviceOwner(ComponentName admin, String ownerName, int userId, public boolean setDeviceOwner(ComponentName admin, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary) { if (!mHasFeature) { logMissingFeatureAction("Cannot set " + ComponentName.flattenToShortString(admin) Loading Loading @@ -18048,11 +18047,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } if (!setActiveAdminAndDeviceOwner( deviceOwnerUserId, deviceAdmin, provisioningParams.getOwnerName())) { if (!setActiveAdminAndDeviceOwner(deviceOwnerUserId, deviceAdmin)) { throw new ServiceSpecificException( ERROR_SET_DEVICE_OWNER_FAILED, "Failed to set device owner."); ERROR_SET_DEVICE_OWNER_FAILED, "Failed to set device owner."); } disallowAddUser(); Loading Loading @@ -18179,12 +18176,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } private boolean setActiveAdminAndDeviceOwner( @UserIdInt int userId, ComponentName adminComponent, String name) { @UserIdInt int userId, ComponentName adminComponent) { enableAndSetActiveAdmin(userId, userId, adminComponent); // TODO(b/178187130): Directly set DO and remove the check once silent provisioning is no // longer used. if (getDeviceOwnerComponent(/* callingUserOnly= */ true) == null) { return setDeviceOwner(adminComponent, name, userId, return setDeviceOwner(adminComponent, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ true); } return true; services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerServiceShellCommand.java +1 −1 Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ final class DevicePolicyManagerServiceShellCommand extends ShellCommand { mService.setActiveAdmin(mComponent, /* refreshing= */ true, mUserId); try { if (!mService.setDeviceOwner(mComponent, mName, mUserId, if (!mService.setDeviceOwner(mComponent, mUserId, /* setProfileOwnerOnCurrentUserIfNecessary= */ !mSetDoOnly)) { throw new RuntimeException( "Can't set package " + mComponent + " as device owner."); Loading Loading
core/api/test-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -523,8 +523,8 @@ package android.app.admin { method @NonNull public static String operationToString(int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void resetDefaultCrossProfileIntentFilters(int); method @RequiresPermission(allOf={android.Manifest.permission.MANAGE_DEVICE_ADMINS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void setActiveAdmin(@NonNull android.content.ComponentName, boolean, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull android.content.ComponentName, @Nullable String, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly(@NonNull android.content.ComponentName, @Nullable String, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull android.content.ComponentName, int); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly(@NonNull android.content.ComponentName, int); method public void setDeviceOwnerType(@NonNull android.content.ComponentName, int); method @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_ADMINS) public void setNextOperationSafety(int, int); method @RequiresPermission(anyOf={android.Manifest.permission.MARK_DEVICE_ORGANIZATION_OWNED, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}, conditional=true) public void setProfileOwnerOnOrganizationOwnedDevice(@NonNull android.content.ComponentName, boolean); Loading
core/java/android/app/admin/DevicePolicyManager.java +5 −7 Original line number Diff line number Diff line Loading @@ -8689,7 +8689,6 @@ public class DevicePolicyManager { * and no accounts. * * @param who the component name to be registered as device owner. * @param ownerName the human readable name of the institution that owns this device. * @param userId ID of the user on which the device owner runs. * * @return whether the package was successfully registered as the device owner. Loading @@ -8701,11 +8700,10 @@ public class DevicePolicyManager { */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwner(@NonNull ComponentName who, @Nullable String ownerName, @UserIdInt int userId) { public boolean setDeviceOwner(@NonNull ComponentName who, @UserIdInt int userId) { if (mService != null) { try { return mService.setDeviceOwner(who, ownerName, userId, return mService.setDeviceOwner(who, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ true); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); Loading @@ -8715,7 +8713,7 @@ public class DevicePolicyManager { } /** * Same as {@link #setDeviceOwner(ComponentName, String, int)}, but without setting the profile * Same as {@link #setDeviceOwner(ComponentName, int)}, but without setting the profile * owner on current user when running on headless system user mode - should be used only by * testing infra. * Loading @@ -8724,10 +8722,10 @@ public class DevicePolicyManager { @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean setDeviceOwnerOnly( @NonNull ComponentName who, @Nullable String ownerName, @UserIdInt int userId) { @NonNull ComponentName who, @UserIdInt int userId) { if (mService != null) { try { return mService.setDeviceOwner(who, ownerName, userId, return mService.setDeviceOwner(who, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ false); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ interface IDevicePolicyManager { void reportKeyguardDismissed(int userHandle); void reportKeyguardSecured(int userHandle); boolean setDeviceOwner(in ComponentName who, String ownerName, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary); boolean setDeviceOwner(in ComponentName who, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary); ComponentName getDeviceOwnerComponent(boolean callingUserOnly); boolean hasDeviceOwner(); String getDeviceOwnerName(); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +5 −8 Original line number Diff line number Diff line Loading @@ -8336,9 +8336,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + PackageManager.FEATURE_DEVICE_ADMIN + " feature."); } // TODO(b/240562946): Remove owner name from API parameters. @Override public boolean setDeviceOwner(ComponentName admin, String ownerName, int userId, public boolean setDeviceOwner(ComponentName admin, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary) { if (!mHasFeature) { logMissingFeatureAction("Cannot set " + ComponentName.flattenToShortString(admin) Loading Loading @@ -18048,11 +18047,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } if (!setActiveAdminAndDeviceOwner( deviceOwnerUserId, deviceAdmin, provisioningParams.getOwnerName())) { if (!setActiveAdminAndDeviceOwner(deviceOwnerUserId, deviceAdmin)) { throw new ServiceSpecificException( ERROR_SET_DEVICE_OWNER_FAILED, "Failed to set device owner."); ERROR_SET_DEVICE_OWNER_FAILED, "Failed to set device owner."); } disallowAddUser(); Loading Loading @@ -18179,12 +18176,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } private boolean setActiveAdminAndDeviceOwner( @UserIdInt int userId, ComponentName adminComponent, String name) { @UserIdInt int userId, ComponentName adminComponent) { enableAndSetActiveAdmin(userId, userId, adminComponent); // TODO(b/178187130): Directly set DO and remove the check once silent provisioning is no // longer used. if (getDeviceOwnerComponent(/* callingUserOnly= */ true) == null) { return setDeviceOwner(adminComponent, name, userId, return setDeviceOwner(adminComponent, userId, /* setProfileOwnerOnCurrentUserIfNecessary= */ true); } return true;
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerServiceShellCommand.java +1 −1 Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ final class DevicePolicyManagerServiceShellCommand extends ShellCommand { mService.setActiveAdmin(mComponent, /* refreshing= */ true, mUserId); try { if (!mService.setDeviceOwner(mComponent, mName, mUserId, if (!mService.setDeviceOwner(mComponent, mUserId, /* setProfileOwnerOnCurrentUserIfNecessary= */ !mSetDoOnly)) { throw new RuntimeException( "Can't set package " + mComponent + " as device owner."); Loading