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

Commit 2a6e2909 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Fix calculateSizeBytes

dataBytes including cacheBytes, so not adding cacheBytes separately.

Bug: 236346018
Test: Unit test
Change-Id: Iac089802d16350eaed9a99c44a6c6558b03385d3
parent 11593b5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,5 +43,5 @@ fun ApplicationInfo.getStorageSize(): State<String> {
private fun ApplicationInfo.calculateSizeBytes(context: Context): Long {
    val storageStatsManager = context.storageStatsManager
    val stats = storageStatsManager.queryStatsForPackage(storageUuid, packageName, userHandle)
    return stats.codeBytes + stats.dataBytes + stats.cacheBytes
    return stats.codeBytes + stats.dataBytes
}
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ class AppStorageSizeTest {
            }
        }

        composeTestRule.waitUntil { storageSize.value == "123 B" }
        composeTestRule.waitUntil { storageSize.value == "120 B" }
    }

    companion object {