summaryrefslogtreecommitdiff
path: root/cmds/dpm
diff options
context:
space:
mode:
authorEran Messeri <eranm@google.com>2019-11-14 22:44:40 +0000
committerEran Messeri <eranm@google.com>2019-11-26 14:57:30 +0000
commit18d21312ca524267db8d5ca70288ee269081aa63 (patch)
tree203c20b415915c1331cb63771ee47ce61da80068 /cmds/dpm
parent804d53c6f2df84b33e333ac1ab032471035e8c80 (diff)
Rename PO Device IDs access -> Org Owned device
Repurpose the "Profile Owner was granted access to device identifiers" to "Profile Owner of an Organization-owned device". The old method now throws an exception, as it should not be called by anything other than ManagedProvisioning (which is changed in this topic). The new method now provides the functionality the old method provided, and there's a new permission associated with it. No functionality has been added or removed in this CL beyond that. Bug: 138709470 Test: atest FrameworksServicesTests:DevicePolicyManagerTest Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDeviceIdAttestationForProfileOwner Change-Id: I9914e8220213898d0c6b3499af8897e3a6f23819
Diffstat (limited to 'cmds/dpm')
-rw-r--r--cmds/dpm/src/com/android/commands/dpm/Dpm.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmds/dpm/src/com/android/commands/dpm/Dpm.java b/cmds/dpm/src/com/android/commands/dpm/Dpm.java
index 6c6797a328c9..d0c2a24d5314 100644
--- a/cmds/dpm/src/com/android/commands/dpm/Dpm.java
+++ b/cmds/dpm/src/com/android/commands/dpm/Dpm.java
@@ -48,8 +48,8 @@ public final class Dpm extends BaseCommand {
private static final String COMMAND_CLEAR_FREEZE_PERIOD_RECORD = "clear-freeze-period-record";
private static final String COMMAND_FORCE_NETWORK_LOGS = "force-network-logs";
private static final String COMMAND_FORCE_SECURITY_LOGS = "force-security-logs";
- private static final String COMMAND_GRANT_PO_DEVICE_ID_ACCESS =
- "grant-profile-owner-device-ids-access";
+ private static final String COMMAND_MARK_PO_ON_ORG_OWNED_DEVICE =
+ "mark-profile-owner-on-organization-owned-device";
private IDevicePolicyManager mDevicePolicyManager;
private int mUserId = UserHandle.USER_SYSTEM;
@@ -93,7 +93,7 @@ public final class Dpm extends BaseCommand {
"dpm " + COMMAND_FORCE_SECURITY_LOGS + ": makes all security logs available to " +
"the DPC and triggers DeviceAdminReceiver.onSecurityLogsAvailable() if needed."
+ "\n"
- + "usage: dpm " + COMMAND_GRANT_PO_DEVICE_ID_ACCESS + ": "
+ + "usage: dpm " + COMMAND_MARK_PO_ON_ORG_OWNED_DEVICE + ": "
+ "[ --user <USER_ID> | current ] <COMPONENT>\n");
}
@@ -129,8 +129,8 @@ public final class Dpm extends BaseCommand {
case COMMAND_FORCE_SECURITY_LOGS:
runForceSecurityLogs();
break;
- case COMMAND_GRANT_PO_DEVICE_ID_ACCESS:
- runGrantProfileOwnerDeviceIdsAccess();
+ case COMMAND_MARK_PO_ON_ORG_OWNED_DEVICE:
+ runMarkProfileOwnerOnOrganizationOwnedDevice();
break;
default:
throw new IllegalArgumentException ("unknown command '" + command + "'");
@@ -251,9 +251,9 @@ public final class Dpm extends BaseCommand {
}
- private void runGrantProfileOwnerDeviceIdsAccess() throws RemoteException {
+ private void runMarkProfileOwnerOnOrganizationOwnedDevice() throws RemoteException {
parseArgs(/*canHaveName=*/ false);
- mDevicePolicyManager.grantDeviceIdsAccessToProfileOwner(mComponent, mUserId);
+ mDevicePolicyManager.markProfileOwnerOnOrganizationOwnedDevice(mComponent, mUserId);
System.out.println("Success");
}