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

Commit e66cd112 authored by Tianjie Xu's avatar Tianjie Xu Committed by Automerger Merge Worker
Browse files

Merge "Add shell command to query if lskf is captured" am: 5b435f9c am:...

Merge "Add shell command to query if lskf is captured" am: 5b435f9c am: d148f096 am: 873b4379 am: 8bd570f5

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1740613

Change-Id: I3216c68e02ba7a24758b551b43f1e1a20b3f375f
parents 3c22a132 8bd570f5
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ public class RecoverySystemShellCommand extends ShellCommand {
                    return requestLskf();
                case "clear-lskf":
                    return clearLskf();
                case "is-lskf-captured":
                    return isLskfCaptured();
                case "reboot-and-apply":
                    return rebootAndApply();
                default:
@@ -74,6 +76,14 @@ public class RecoverySystemShellCommand extends ShellCommand {
        return 0;
    }

    private int isLskfCaptured() throws RemoteException {
        String packageName = getNextArgRequired();
        boolean captured = mService.isLskfCaptured(packageName);
        PrintWriter pw = getOutPrintWriter();
        pw.printf("%s LSKF capture status: %s\n", packageName, captured ? "true" : "false");
        return 0;
    }

    private int rebootAndApply() throws RemoteException {
        String packageName = getNextArgRequired();
        String rebootReason = getNextArgRequired();
@@ -90,8 +100,9 @@ public class RecoverySystemShellCommand extends ShellCommand {
    public void onHelp() {
        PrintWriter pw = getOutPrintWriter();
        pw.println("Recovery system commands:");
        pw.println("  request-lskf <token>");
        pw.println("  request-lskf <package_name>");
        pw.println("  clear-lskf");
        pw.println("  reboot-and-apply <token> <reason>");
        pw.println("  is-lskf-captured <package_name>");
        pw.println("  reboot-and-apply <package_name> <reason>");
    }
}