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

Commit 38c28f3b authored by Daeho Jeong's avatar Daeho Jeong
Browse files

Make smart idle maint update write amount record every period



Now, when the condition doesn't meet, smart idle maintenance service
doesn't update write amount record. Fixed it, since it should be updated
every period.

Bug: 241601216
Test: check smart idle maint log of StorageManagerService
Signed-off-by: default avatarDaeho Jeong <daehojeong@google.com>
Change-Id: I339109fcaa821620a3b9b4b8c49e25fd18d03cf3
Merged-In: I339109fcaa821620a3b9b4b8c49e25fd18d03cf3
parent 38215c1d
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -2829,13 +2829,6 @@ class StorageManagerService extends IStorageManager.Stub
        enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);

        try {
            // Block based checkpoint process runs fstrim. So, if checkpoint is in progress
            // (first boot after OTA), We skip the smart idle maintenance
            if (!needsCheckpoint() || !supportsBlockCheckpoint()) {
                if (!refreshLifetimeConstraint() || !checkChargeStatus()) {
                    return;
                }

            int latestWrite = mVold.getWriteAmount();
            if (latestWrite == -1) {
                Slog.w(TAG, "Failed to get storage write record");
@@ -2843,6 +2836,14 @@ class StorageManagerService extends IStorageManager.Stub
            }

            updateStorageWriteRecords(latestWrite);

            // Block based checkpoint process runs fstrim. So, if checkpoint is in progress
            // (first boot after OTA), We skip the smart idle maintenance
            if (!needsCheckpoint() || !supportsBlockCheckpoint()) {
                if (!refreshLifetimeConstraint() || !checkChargeStatus()) {
                    return;
                }

                int avgWriteAmount = getAverageWriteAmount();

                Slog.i(TAG, "Set smart idle maintenance: " + "latest write amount: " +