Don't show game and music apps in Other Apps.

Bug: 35143240
Test: SettingsLib Robotest
Change-Id: Ifaa086373d27dc81203137d20fa1617df21f6093
This commit is contained in:
Daniel Nishi
2017-02-08 12:20:12 -08:00
parent d5015bec23
commit bd8c6652cd
2 changed files with 37 additions and 0 deletions

View File

@@ -1504,4 +1504,20 @@ public class ApplicationsState {
return isMusicApp;
}
};
public static final AppFilter FILTER_OTHER_APPS = new AppFilter() {
@Override
public void init() {
}
@Override
public boolean filterApp(AppEntry entry) {
boolean isCategorized;
synchronized(entry) {
isCategorized = entry.info.category == ApplicationInfo.CATEGORY_AUDIO ||
entry.info.category == ApplicationInfo.CATEGORY_GAME;
}
return !isCategorized;
}
};
}

View File

@@ -86,4 +86,25 @@ public class ApplicationsStateTest {
assertThat(ApplicationsState.FILTER_AUDIO.filterApp(mEntry)).isFalse();
}
@Test
public void testOtherAppsRejectsAudio() {
mEntry.info.category = ApplicationInfo.CATEGORY_AUDIO;
assertThat(ApplicationsState.FILTER_OTHER_APPS.filterApp(mEntry)).isFalse();
}
@Test
public void testOtherAppsRejectsGame() {
mEntry.info.category = ApplicationInfo.CATEGORY_GAME;
assertThat(ApplicationsState.FILTER_OTHER_APPS.filterApp(mEntry)).isFalse();
}
@Test
public void testOtherAppsAcceptsDefaultCategory() {
mEntry.info.category = ApplicationInfo.CATEGORY_UNDEFINED;
assertThat(ApplicationsState.FILTER_OTHER_APPS.filterApp(mEntry)).isTrue();
}
}