Merge commit '47eec246a9293616cb74d2c354be85201ec4e19e' into mergeit

Change-Id: I988ae328e0e9bb99b086490cf2ef48ca19779d13
This commit is contained in:
Jeff Sharkey
2017-05-31 09:05:30 -06:00
10 changed files with 66 additions and 62 deletions

View File

@@ -133,9 +133,9 @@ public class StorageAsyncLoaderTest {
info.id = SECONDARY_USER_ID;
mUsers.add(info);
when(mSource.getExternalStorageStats(anyString(), eq(UserHandle.SYSTEM)))
.thenReturn(new StorageStatsSource.ExternalStorageStats(9, 2, 3, 4));
.thenReturn(new StorageStatsSource.ExternalStorageStats(9, 2, 3, 4, 0));
when(mSource.getExternalStorageStats(anyString(), eq(new UserHandle(SECONDARY_USER_ID))))
.thenReturn(new StorageStatsSource.ExternalStorageStats(10, 3, 3, 4));
.thenReturn(new StorageStatsSource.ExternalStorageStats(10, 3, 3, 4, 0));
SparseArray<StorageAsyncLoader.AppsStorageResult> result = mLoader.loadInBackground();
@@ -144,19 +144,6 @@ public class StorageAsyncLoaderTest {
assertThat(result.get(SECONDARY_USER_ID).externalStats.totalBytes).isEqualTo(10L);
}
@Test
public void testSystemAppsBaseSizeIsAddedToSystem() throws Exception {
ApplicationInfo systemApp =
addPackage(PACKAGE_NAME_1, 100, 1, 10, ApplicationInfo.CATEGORY_UNDEFINED);
systemApp.flags = ApplicationInfo.FLAG_SYSTEM;
SparseArray<StorageAsyncLoader.AppsStorageResult> result = mLoader.loadInBackground();
assertThat(result.size()).isEqualTo(1);
assertThat(result.get(PRIMARY_USER_ID).otherAppsSize).isEqualTo(10L);
assertThat(result.get(PRIMARY_USER_ID).systemSize).isEqualTo(1L);
}
@Test
public void testUpdatedSystemAppCodeSizeIsCounted() throws Exception {
ApplicationInfo systemApp =