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

Commit 52cd1c57 authored by Jin Qian's avatar Jin Qian
Browse files

Add 'idle-maint' command for use from shell

Test: adb shell sm idle-maint [run|abort]
Bug: 67776637
Change-Id: I5f20adc45aad29dc9267a70bf3eea6a1fa490688
parent a85b9919
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -101,6 +101,8 @@ public final class Sm {
            runSetEmulateFbe();
        } else if ("get-fbe-mode".equals(op)) {
            runGetFbeMode();
        } else if ("idle-maint".equals(op)) {
            runIdleMaint();
        } else if ("fstrim".equals(op)) {
            runFstrim();
        } else if ("set-virtual-disk".equals(op)) {
@@ -278,6 +280,15 @@ public final class Sm {
                StorageManager.DEBUG_VIRTUAL_DISK);
    }

    public void runIdleMaint() throws RemoteException {
        final boolean im_run = "run".equals(nextArg());
        if (im_run) {
            mSm.runIdleMaintenance();
        } else {
            mSm.abortIdleMaintenance();
        }
    }

    private String nextArg() {
        if (mNextArg >= mArgs.length) {
            return null;
@@ -300,6 +311,7 @@ public final class Sm {
        System.err.println("       sm unmount VOLUME");
        System.err.println("       sm format VOLUME");
        System.err.println("       sm benchmark VOLUME");
        System.err.println("       sm idle-maint [run|abort]");
        System.err.println("       sm fstrim");
        System.err.println("");
        System.err.println("       sm forget [UUID|all]");