Loading src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ public class StorageAsyncLoader result.musicAppsSize += attributedAppSizeInBytes; break; default: // The deprecated game flag does not set the category. if ((app.flags & ApplicationInfo.FLAG_IS_GAME) != 0) { result.gamesSize += attributedAppSizeInBytes; break; } result.otherAppsSize += attributedAppSizeInBytes; break; } Loading tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,19 @@ public class StorageAsyncLoaderTest { assertThat(result.get(PRIMARY_USER_ID).otherAppsSize).isEqualTo(0); } @Test public void testLegacyGamesAreFiltered() throws Exception { ApplicationInfo info = addPackage(PACKAGE_NAME_1, 0, 1, 10, ApplicationInfo.CATEGORY_UNDEFINED); info.flags = ApplicationInfo.FLAG_IS_GAME; SparseArray<StorageAsyncLoader.AppsStorageResult> result = mLoader.loadInBackground(); assertThat(result.size()).isEqualTo(1); assertThat(result.get(PRIMARY_USER_ID).gamesSize).isEqualTo(11L); assertThat(result.get(PRIMARY_USER_ID).otherAppsSize).isEqualTo(0); } @Test public void testCacheIsIgnored() throws Exception { addPackage(PACKAGE_NAME_1, 100, 1, 10, ApplicationInfo.CATEGORY_UNDEFINED); Loading Loading
src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ public class StorageAsyncLoader result.musicAppsSize += attributedAppSizeInBytes; break; default: // The deprecated game flag does not set the category. if ((app.flags & ApplicationInfo.FLAG_IS_GAME) != 0) { result.gamesSize += attributedAppSizeInBytes; break; } result.otherAppsSize += attributedAppSizeInBytes; break; } Loading
tests/unit/src/com/android/settings/deviceinfo/storage/StorageAsyncLoaderTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,19 @@ public class StorageAsyncLoaderTest { assertThat(result.get(PRIMARY_USER_ID).otherAppsSize).isEqualTo(0); } @Test public void testLegacyGamesAreFiltered() throws Exception { ApplicationInfo info = addPackage(PACKAGE_NAME_1, 0, 1, 10, ApplicationInfo.CATEGORY_UNDEFINED); info.flags = ApplicationInfo.FLAG_IS_GAME; SparseArray<StorageAsyncLoader.AppsStorageResult> result = mLoader.loadInBackground(); assertThat(result.size()).isEqualTo(1); assertThat(result.get(PRIMARY_USER_ID).gamesSize).isEqualTo(11L); assertThat(result.get(PRIMARY_USER_ID).otherAppsSize).isEqualTo(0); } @Test public void testCacheIsIgnored() throws Exception { addPackage(PACKAGE_NAME_1, 100, 1, 10, ApplicationInfo.CATEGORY_UNDEFINED); Loading