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

Commit a8831ba8 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am 5b9f8dd7: am 2ebbf4c8: Merge "Special interval value to always run benchmarks." into mnc-dr-dev

* commit '5b9f8dd7':
  Special interval value to always run benchmarks.
parents f27035d9 5b9f8dd7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -368,11 +368,17 @@ class MountService extends IMountService.Stub
    private boolean shouldBenchmark() {
        final long benchInterval = Settings.Global.getLong(mContext.getContentResolver(),
                Settings.Global.STORAGE_BENCHMARK_INTERVAL, DateUtils.WEEK_IN_MILLIS);
        if (benchInterval == -1) {
            return false;
        } else if (benchInterval == 0) {
            return true;
        }

        synchronized (mLock) {
            for (int i = 0; i < mVolumes.size(); i++) {
                final VolumeInfo vol = mVolumes.valueAt(i);
                final VolumeRecord rec = mRecords.get(vol.fsUuid);
                if (vol.isMountedReadable() && rec != null) {
                if (vol.isMountedWritable() && rec != null) {
                    final long benchAge = System.currentTimeMillis() - rec.lastBenchMillis;
                    if (benchAge >= benchInterval) {
                        return true;