Merge "Change how we calculate system size." into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-19 23:33:56 +00:00
committed by Android (Google) Code Review
3 changed files with 25 additions and 23 deletions

View File

@@ -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");
}