Add 'all apps' to notification filters
Test: atest Fixes: 141138853 Change-Id: If77e8186ddbfc754e7bb1a3d8541840f09db38d9
This commit is contained in:
@@ -58,12 +58,12 @@ public class AppFilterRegistry {
|
||||
// Filters will appear sorted based on their value defined here.
|
||||
public static final int FILTER_APPS_POWER_WHITELIST = 0;
|
||||
public static final int FILTER_APPS_POWER_WHITELIST_ALL = 1;
|
||||
public static final int FILTER_APPS_ALL = 2;
|
||||
public static final int FILTER_APPS_ENABLED = 3;
|
||||
public static final int FILTER_APPS_INSTANT = 4;
|
||||
public static final int FILTER_APPS_DISABLED = 5;
|
||||
public static final int FILTER_APPS_RECENT = 6;
|
||||
public static final int FILTER_APPS_FREQUENT = 7;
|
||||
public static final int FILTER_APPS_RECENT = 2;
|
||||
public static final int FILTER_APPS_FREQUENT = 3;
|
||||
public static final int FILTER_APPS_ALL = 4;
|
||||
public static final int FILTER_APPS_ENABLED = 5;
|
||||
public static final int FILTER_APPS_INSTANT = 6;
|
||||
public static final int FILTER_APPS_DISABLED = 7;
|
||||
public static final int FILTER_APPS_PERSONAL = 8;
|
||||
public static final int FILTER_APPS_WORK = 9;
|
||||
public static final int FILTER_APPS_USAGE_ACCESS = 10;
|
||||
|
@@ -476,7 +476,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_RECENT);
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_FREQUENT);
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_BLOCKED);
|
||||
mFilterAdapter.disableFilter(FILTER_APPS_ALL);
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_ALL);
|
||||
}
|
||||
if (mListType == LIST_TYPE_HIGH_POWER) {
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
|
||||
@@ -1089,12 +1089,16 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mAppFilter = appFilter;
|
||||
|
||||
// Notification filters require resorting the list
|
||||
if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) {
|
||||
if (FILTER_APPS_FREQUENT == appFilter.getFilterType()) {
|
||||
rebuild(R.id.sort_order_frequent_notification);
|
||||
} else if (FILTER_APPS_RECENT == appFilter.getFilterType()) {
|
||||
rebuild(R.id.sort_order_recent_notification);
|
||||
} else if (FILTER_APPS_BLOCKED == appFilter.getFilterType()) {
|
||||
rebuild(R.id.sort_order_alpha);
|
||||
} else {
|
||||
rebuild(R.id.sort_order_alpha);
|
||||
}
|
||||
} else {
|
||||
rebuild();
|
||||
}
|
||||
|
@@ -570,12 +570,14 @@ public class ManageApplicationsTest {
|
||||
|
||||
mFragment.createHeader();
|
||||
|
||||
assertThat(mFragment.mFilterAdapter.getCount()).isEqualTo(3);
|
||||
assertThat(mFragment.mFilterAdapter.getCount()).isEqualTo(4);
|
||||
assertThat(mFragment.mFilterAdapter.getItem(0)).isEqualTo(
|
||||
mContext.getString(R.string.sort_order_recent_notification));
|
||||
assertThat(mFragment.mFilterAdapter.getItem(1)).isEqualTo(
|
||||
mContext.getString(R.string.sort_order_frequent_notification));
|
||||
assertThat(mFragment.mFilterAdapter.getItem(2)).isEqualTo(
|
||||
mContext.getString(R.string.filter_all_apps));
|
||||
assertThat(mFragment.mFilterAdapter.getItem(3)).isEqualTo(
|
||||
mContext.getString(R.string.filter_notif_blocked_apps));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user