Merge "Fixed message on cmd device_policy is-operation-safe" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e8c798ba11
@@ -100,8 +100,8 @@ final class DevicePolicyManagerServiceShellCommand extends ShellCommand {
|
||||
int operation = Integer.parseInt(getNextArgRequired());
|
||||
int reason = mService.getUnsafeOperationReason(operation);
|
||||
boolean safe = reason == DevicePolicyManager.OPERATION_SAFETY_REASON_NONE;
|
||||
pw.printf("Operation %s is %b. Reason: %s\n",
|
||||
DevicePolicyManager.operationToString(operation), safe,
|
||||
pw.printf("Operation %s is %s. Reason: %s\n",
|
||||
DevicePolicyManager.operationToString(operation), safeToString(safe),
|
||||
DevicePolicyManager.operationSafetyReasonToString(reason));
|
||||
return 0;
|
||||
}
|
||||
@@ -110,11 +110,14 @@ final class DevicePolicyManagerServiceShellCommand extends ShellCommand {
|
||||
int reason = Integer.parseInt(getNextArgRequired());
|
||||
boolean safe = mService.isSafeOperation(reason);
|
||||
pw.printf("Operations affected by %s are %s\n",
|
||||
DevicePolicyManager.operationSafetyReasonToString(reason),
|
||||
(safe ? "SAFE" : "UNSAFE"));
|
||||
DevicePolicyManager.operationSafetyReasonToString(reason), safeToString(safe));
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static String safeToString(boolean safe) {
|
||||
return safe ? "SAFE" : "UNSAFE";
|
||||
}
|
||||
|
||||
private int runSetSafeOperation(PrintWriter pw) {
|
||||
int operation = Integer.parseInt(getNextArgRequired());
|
||||
int reason = Integer.parseInt(getNextArgRequired());
|
||||
|
||||
Reference in New Issue
Block a user