Expose isRemovingAdmin in DevicePolicyManager as a TestApi.

Fixes: 219894175

Test: android.devicepolicy.cts.DevicePolicyManagerTest#setAndRemoveDeviceOwnerRepeatedly_doesNotThrowError
Test: android.devicepolicy.cts.DevicePolicyManagerTest#setAndRemoveProfileOwnerRepeatedly_doesNotThrowError
Change-Id: Ifd9fc00878ce8243c0f34eca827b5a857ffc1b2f
This commit is contained in:
Elis Elliott
2022-02-25 10:03:07 +00:00
parent de4a9a6a06
commit b6d3083b06
2 changed files with 2 additions and 0 deletions

View File

@@ -514,6 +514,7 @@ package android.app.admin {
method public boolean isCurrentInputMethodSetByOwner();
method public boolean isFactoryResetProtectionPolicySupported();
method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public boolean isNewUserDisclaimerAcknowledged();
method public boolean isRemovingAdmin(@NonNull android.content.ComponentName, int);
method @RequiresPermission(anyOf={android.Manifest.permission.MARK_DEVICE_ORGANIZATION_OWNED, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}, conditional=true) public void markProfileOwnerOnOrganizationOwnedDevice(@NonNull android.content.ComponentName);
method @NonNull public static String operationSafetyReasonToString(int);
method @NonNull public static String operationToString(int);

View File

@@ -3762,6 +3762,7 @@ public class DevicePolicyManager {
* for the user.
* @hide
*/
@TestApi
public boolean isRemovingAdmin(@NonNull ComponentName admin, int userId) {
if (mService != null) {
try {