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

Commit 9460e54a authored by Daniel Nishi's avatar Daniel Nishi Committed by android-build-merger
Browse files

Merge "Remove the cache size from internal size." into qt-dev

am: 10f78591

Change-Id: Id9e87dcada22fb48218ddd2c9bfc2293fd5ece18
parents dcdee808 10f78591
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -707,7 +707,9 @@ public class ApplicationsState {


    private long getTotalInternalSize(PackageStats ps) {
    private long getTotalInternalSize(PackageStats ps) {
        if (ps != null) {
        if (ps != null) {
            return ps.codeSize + ps.dataSize;
            // We subtract the cache size because the system can clear it automatically and
            // |dataSize| is a superset of |cacheSize|.
            return ps.codeSize + ps.dataSize - ps.cacheSize;
        }
        }
        return SIZE_INVALID;
        return SIZE_INVALID;
    }
    }
@@ -715,7 +717,7 @@ public class ApplicationsState {
    private long getTotalExternalSize(PackageStats ps) {
    private long getTotalExternalSize(PackageStats ps) {
        if (ps != null) {
        if (ps != null) {
            // We also include the cache size here because for non-emulated
            // We also include the cache size here because for non-emulated
            // we don't automtically clean cache files.
            // we don't automatically clean cache files.
            return ps.externalCodeSize + ps.externalDataSize
            return ps.externalCodeSize + ps.externalDataSize
                    + ps.externalCacheSize
                    + ps.externalCacheSize
                    + ps.externalMediaSize + ps.externalObbSize;
                    + ps.externalMediaSize + ps.externalObbSize;
+2 −1
Original line number Original line Diff line number Diff line
@@ -191,8 +191,9 @@ public class ApplicationsStateRoboTest {
        shadowContext.setSystemService(Context.STORAGE_STATS_SERVICE, mStorageStatsManager);
        shadowContext.setSystemService(Context.STORAGE_STATS_SERVICE, mStorageStatsManager);
        StorageStats storageStats = new StorageStats();
        StorageStats storageStats = new StorageStats();
        storageStats.codeBytes = 10;
        storageStats.codeBytes = 10;
        storageStats.dataBytes = 20;
        storageStats.cacheBytes = 30;
        storageStats.cacheBytes = 30;
        // Data bytes are a superset of cache bytes.
        storageStats.dataBytes = storageStats.cacheBytes + 20;
        when(mStorageStatsManager.queryStatsForPackage(any(UUID.class),
        when(mStorageStatsManager.queryStatsForPackage(any(UUID.class),
            anyString(), any(UserHandle.class))).thenReturn(storageStats);
            anyString(), any(UserHandle.class))).thenReturn(storageStats);