import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
import com.android.settingslib.applications.ApplicationsState.AppFilter;
+import com.android.settingslib.applications.ApplicationsState.CompoundFilter;
import java.util.ArrayList;
public boolean isSystemHighPower;
}
- public static final AppFilter FILTER_POWER_WHITELISTED = new AppFilter() {
+ public static final AppFilter FILTER_POWER_WHITELISTED = new CompoundFilter(
+ ApplicationsState.FILTER_PERSONAL, new AppFilter() {
@Override
public void init() {
}
public boolean filterApp(AppEntry info) {
return info.extraInfo == Boolean.TRUE;
}
- };
-
- public static final AppFilter FILTER_POWER_NOT_WHITELISTED = new AppFilter() {
- @Override
- public void init() {
- }
-
- @Override
- public boolean filterApp(AppEntry info) {
- return info.extraInfo == Boolean.FALSE;
- }
- };
-
+ });
}
// Filter options used for displayed list of applications
// The order which they appear is the order they will show when spinner is present.
public static final int FILTER_APPS_POWER_WHITELIST = 0;
- public static final int FILTER_APPS_ALL = 1;
- public static final int FILTER_APPS_ENABLED = 2;
- public static final int FILTER_APPS_DISABLED = 3;
- public static final int FILTER_APPS_BLOCKED = 4;
- public static final int FILTER_APPS_PRIORITY = 5;
- public static final int FILTER_APPS_NO_PEEKING = 6;
- public static final int FILTER_APPS_SENSITIVE = 7;
- public static final int FILTER_APPS_PERSONAL = 8;
- public static final int FILTER_APPS_WORK = 9;
- public static final int FILTER_APPS_WITH_DOMAIN_URLS = 10;
- public static final int FILTER_APPS_USAGE_ACCESS = 11;
+ 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_DISABLED = 4;
+ public static final int FILTER_APPS_BLOCKED = 5;
+ public static final int FILTER_APPS_PRIORITY = 6;
+ public static final int FILTER_APPS_NO_PEEKING = 7;
+ public static final int FILTER_APPS_SENSITIVE = 8;
+ public static final int FILTER_APPS_PERSONAL = 9;
+ public static final int FILTER_APPS_WORK = 10;
+ public static final int FILTER_APPS_WITH_DOMAIN_URLS = 11;
+ public static final int FILTER_APPS_USAGE_ACCESS = 12;
// This is the string labels for the filter modes above, the order must be kept in sync.
public static final int[] FILTER_LABELS = new int[] {
- R.string.high_power_filter_on, // High power whitelist, on
+ R.string.high_power_filter_on, // High power whitelist, on
+ R.string.filter_all_apps, // All apps label, but personal filter (for high power);
R.string.filter_all_apps, // All apps
R.string.filter_enabled_apps, // Enabled
R.string.filter_apps_disabled, // Disabled
// be kept in sync.
public static final AppFilter[] FILTERS = new AppFilter[] {
AppStatePowerBridge.FILTER_POWER_WHITELISTED, // High power whitelist, on
+ ApplicationsState.FILTER_PERSONAL, // All apps label, but personal filter
ApplicationsState.FILTER_EVERYTHING, // All apps
ApplicationsState.FILTER_ALL_ENABLED, // Enabled
ApplicationsState.FILTER_DISABLED, // Disabled
mFilterAdapter.enableFilter(FILTER_APPS_NO_PEEKING);
}
if (mListType == LIST_TYPE_HIGH_POWER) {
- mFilterAdapter.enableFilter(FILTER_APPS_ALL);
+ mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
}
if (mListType == LIST_TYPE_STORAGE) {
mApplications.setOverrideFilter(new VolumeFilter(mVolumeUuid));