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

Commit 6cb70458 authored by Biswarup Pal's avatar Biswarup Pal Committed by Automerger Merge Worker
Browse files

Merge "Free only the required bytes from StorageManagerService" into sc-dev am: 4f8d78e7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14034626

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