Change how we calculate system size.
As per storage discussions, the best way to calculate storage for the System is to just take all known data and subtract it from the used bytes. There is more to the system than just the /system partition and, even if we ignore the partitions and use the underlying block device method of calculating it, we run into the problem of it not adding up to the actual device size. Change-Id: I6e1f775ea3f3b8b2cc78d734623934651e2fb7b4 Fixes: 37166310 Test: Robotests
This commit is contained in:
@@ -242,21 +242,19 @@ public class StorageItemPreferenceControllerTest {
|
||||
eq(StorageItemPreferenceController.FILES_KEY))).thenReturn(files);
|
||||
mController.displayPreference(screen);
|
||||
|
||||
mController.setSystemSize(KILOBYTE * 6);
|
||||
mController.setUsedSize(KILOBYTE * 200); // There should 87kB attributed.
|
||||
StorageAsyncLoader.AppsStorageResult result = new StorageAsyncLoader.AppsStorageResult();
|
||||
result.gamesSize = KILOBYTE * 8;
|
||||
result.videoAppsSize = KILOBYTE * 16;
|
||||
result.musicAppsSize = KILOBYTE * 4;
|
||||
result.otherAppsSize = KILOBYTE * 9;
|
||||
result.systemSize = KILOBYTE * 10;
|
||||
result.systemSize = KILOBYTE * 10; // This value is ignored and overriden now.
|
||||
result.externalStats = new StorageStatsSource.ExternalStorageStats(
|
||||
KILOBYTE * 50, // total
|
||||
KILOBYTE * 10, // audio
|
||||
KILOBYTE * 15, // video
|
||||
KILOBYTE * 20); // image
|
||||
|
||||
result.gamesSize = KILOBYTE * 8;
|
||||
result.otherAppsSize = KILOBYTE * 9;
|
||||
mController.onLoadFinished(result);
|
||||
|
||||
assertThat(audio.getSummary().toString()).isEqualTo("14.00KB"); // 4KB apps + 10KB files
|
||||
@@ -264,7 +262,7 @@ public class StorageItemPreferenceControllerTest {
|
||||
assertThat(games.getSummary().toString()).isEqualTo("8.00KB");
|
||||
assertThat(movies.getSummary().toString()).isEqualTo("16.00KB");
|
||||
assertThat(apps.getSummary().toString()).isEqualTo("9.00KB");
|
||||
assertThat(system.getSummary().toString()).isEqualTo("16.00KB");
|
||||
assertThat(system.getSummary().toString()).isEqualTo("113KB");
|
||||
assertThat(files.getSummary().toString()).isEqualTo("5.00KB");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user