Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46771d10 authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed message on cmd device_policy is-operation-safe

Test: adb shell cmd device_policy is-operation-safe 7
Bug: 172376923

Change-Id: Ia8bdcde96728507f78495f12255894e2f02dc978
parent c8472887
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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());