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. Test: check smart idle maint log of StorageManagerService Signed-off-by: Daeho Jeong <daehojeong@google.com> Change-Id: I339109fcaa821620a3b9b4b8c49e25fd18d03cf3
This commit is contained in:
@@ -2728,6 +2728,14 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
|
||||
|
||||
try {
|
||||
int latestWrite = mVold.getWriteAmount();
|
||||
if (latestWrite == -1) {
|
||||
Slog.w(TAG, "Failed to get storage write record");
|
||||
return;
|
||||
}
|
||||
|
||||
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()) {
|
||||
@@ -2735,13 +2743,6 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
return;
|
||||
}
|
||||
|
||||
int latestWrite = mVold.getWriteAmount();
|
||||
if (latestWrite == -1) {
|
||||
Slog.w(TAG, "Failed to get storage write record");
|
||||
return;
|
||||
}
|
||||
|
||||
updateStorageWriteRecords(latestWrite);
|
||||
int avgWriteAmount = getAverageWriteAmount();
|
||||
|
||||
Slog.i(TAG, "Set smart idle maintenance: " + "latest write amount: " +
|
||||
|
||||
Reference in New Issue
Block a user