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

Commit 49a5838b authored by Jin Qian's avatar Jin Qian
Browse files

Run gc + fstrim for idle maintenance

Test:
adb shell cmd jobscheduler get-job-state android 808
adb shell cmd jobscheduler run android 808
adb shell cmd jobscheduler timeout android 808

Bug: 67776637
Change-Id: I8e0d01891a689f9a9181160611657e2cda531c0f
parent 52cd1c57
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public class MountServiceIdler extends JobService {
            synchronized (mFinishCallback) {
                mStarted = true;
            }
            ms.runIdleMaintenance(mFinishCallback);
            ms.runIdleMaint(mFinishCallback);
        }
        return ms != null;
    }
@@ -82,9 +82,13 @@ public class MountServiceIdler extends JobService {
        // Once we kick off the fstrim we aren't actually interruptible; just note
        // that we don't need to call jobFinished(), and let everything happen in
        // the callback from the mount service.
        StorageManagerService ms = StorageManagerService.sSelf;
        if (ms != null) {
            ms.abortIdleMaint(mFinishCallback);
            synchronized (mFinishCallback) {
                mStarted = false;
            }
        }
        return false;
    }