Loading src/com/android/settings/applications/ManageApplications.java +3 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,9 @@ public class ManageApplications extends InstrumentedPreferenceFragment } // Storage types. Used to determine what the extra item in the list of preferences is. public static final int STORAGE_TYPE_DEFAULT = 0; public static final int STORAGE_TYPE_DEFAULT = 0; // Show all apps that are not categorized. public static final int STORAGE_TYPE_MUSIC = 1; public static final int STORAGE_TYPE_LEGACY = 2; // Show apps even if they can be categorized. // sort order private int mSortOrder = R.id.sort_order_alpha; Loading Loading @@ -433,7 +434,7 @@ public class ManageApplications extends InstrumentedPreferenceFragment if (listType == LIST_TYPE_STORAGE) { if (storageType == STORAGE_TYPE_MUSIC) { filter = new CompoundFilter(ApplicationsState.FILTER_AUDIO, filter); } else { } else if (storageType == STORAGE_TYPE_DEFAULT) { filter = new CompoundFilter(ApplicationsState.FILTER_OTHER_APPS, filter); } return filter; Loading src/com/android/settings/deviceinfo/PrivateVolumeSettings.java +3 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,9 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment { StorageUseActivity.class.getName()); args.putString(ManageApplications.EXTRA_VOLUME_UUID, mVolume.getFsUuid()); args.putString(ManageApplications.EXTRA_VOLUME_NAME, mVolume.getDescription()); args.putInt( ManageApplications.EXTRA_STORAGE_TYPE, ManageApplications.STORAGE_TYPE_LEGACY); intent = Utils.onBuildStartFragmentIntent(getActivity(), ManageApplications.class.getName(), args, null, R.string.apps_storage, null, false, getMetricsCategory()); Loading tests/unit/src/com/android/settings/applications/ManageApplicationsUnitTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -116,4 +116,20 @@ public class ManageApplicationsUnitTest { assertThat(composedFilter.filterApp(appEntry)).isTrue(); } @Test public void getCompositeFilter_worksForLegacyPrivateSettings() throws Exception { ApplicationsState.AppFilter filter = ManageApplications.getCompositeFilter( ManageApplications.LIST_TYPE_STORAGE, ManageApplications.STORAGE_TYPE_LEGACY, "uuid"); final ApplicationInfo info = new ApplicationInfo(); info.volumeUuid = "uuid"; info.category = ApplicationInfo.CATEGORY_GAME; final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class); appEntry.info = info; assertThat(filter.filterApp(appEntry)).isTrue(); } } Loading
src/com/android/settings/applications/ManageApplications.java +3 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,9 @@ public class ManageApplications extends InstrumentedPreferenceFragment } // Storage types. Used to determine what the extra item in the list of preferences is. public static final int STORAGE_TYPE_DEFAULT = 0; public static final int STORAGE_TYPE_DEFAULT = 0; // Show all apps that are not categorized. public static final int STORAGE_TYPE_MUSIC = 1; public static final int STORAGE_TYPE_LEGACY = 2; // Show apps even if they can be categorized. // sort order private int mSortOrder = R.id.sort_order_alpha; Loading Loading @@ -433,7 +434,7 @@ public class ManageApplications extends InstrumentedPreferenceFragment if (listType == LIST_TYPE_STORAGE) { if (storageType == STORAGE_TYPE_MUSIC) { filter = new CompoundFilter(ApplicationsState.FILTER_AUDIO, filter); } else { } else if (storageType == STORAGE_TYPE_DEFAULT) { filter = new CompoundFilter(ApplicationsState.FILTER_OTHER_APPS, filter); } return filter; Loading
src/com/android/settings/deviceinfo/PrivateVolumeSettings.java +3 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,9 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment { StorageUseActivity.class.getName()); args.putString(ManageApplications.EXTRA_VOLUME_UUID, mVolume.getFsUuid()); args.putString(ManageApplications.EXTRA_VOLUME_NAME, mVolume.getDescription()); args.putInt( ManageApplications.EXTRA_STORAGE_TYPE, ManageApplications.STORAGE_TYPE_LEGACY); intent = Utils.onBuildStartFragmentIntent(getActivity(), ManageApplications.class.getName(), args, null, R.string.apps_storage, null, false, getMetricsCategory()); Loading
tests/unit/src/com/android/settings/applications/ManageApplicationsUnitTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -116,4 +116,20 @@ public class ManageApplicationsUnitTest { assertThat(composedFilter.filterApp(appEntry)).isTrue(); } @Test public void getCompositeFilter_worksForLegacyPrivateSettings() throws Exception { ApplicationsState.AppFilter filter = ManageApplications.getCompositeFilter( ManageApplications.LIST_TYPE_STORAGE, ManageApplications.STORAGE_TYPE_LEGACY, "uuid"); final ApplicationInfo info = new ApplicationInfo(); info.volumeUuid = "uuid"; info.category = ApplicationInfo.CATEGORY_GAME; final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class); appEntry.info = info; assertThat(filter.filterApp(appEntry)).isTrue(); } }