Merge "Free only the required bytes from StorageManagerService" into sc-dev

This commit is contained in:
Biswarup Pal
2021-04-01 10:35:15 +00:00
committed by Android (Google) Code Review

View File

@@ -8203,9 +8203,10 @@ public class PackageManagerService extends IPackageManager.Stub
// 11. Free storage service cache // 11. Free storage service cache
StorageManagerInternal smInternal = StorageManagerInternal smInternal =
mInjector.getLocalService(StorageManagerInternal.class); mInjector.getLocalService(StorageManagerInternal.class);
// TODO(b/170481432): Decide what value of bytes needs to be sent instead of long freeBytesRequired = bytes - file.getUsableSpace();
// sending the bytes parameter of freeStorage if (freeBytesRequired > 0) {
smInternal.freeCache(volumeUuid, bytes); smInternal.freeCache(volumeUuid, freeBytesRequired);
}
if (file.getUsableSpace() >= bytes) return; if (file.getUsableSpace() >= bytes) return;
} else { } else {
try { try {