Update language to comply with Android's inclusive language guidance
Refactor PowerWhitelistBackend to PowerAllowlistBackend See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: robotest & manual Change-Id: I3d56e6dac1515b49a89f59c34edf403ecb891420
This commit is contained in:
@@ -35,8 +35,8 @@ import com.android.settingslib.applications.ApplicationsState;
|
||||
public class AppFilterRegistry {
|
||||
|
||||
@IntDef(value = {
|
||||
FILTER_APPS_POWER_WHITELIST,
|
||||
FILTER_APPS_POWER_WHITELIST_ALL,
|
||||
FILTER_APPS_POWER_ALLOWLIST,
|
||||
FILTER_APPS_POWER_ALLOWLIST_ALL,
|
||||
FILTER_APPS_ALL,
|
||||
FILTER_APPS_ENABLED,
|
||||
FILTER_APPS_INSTANT,
|
||||
@@ -56,8 +56,8 @@ public class AppFilterRegistry {
|
||||
|
||||
// Filter options used for displayed list of applications
|
||||
// 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_POWER_ALLOWLIST = 0;
|
||||
public static final int FILTER_APPS_POWER_ALLOWLIST_ALL = 1;
|
||||
public static final int FILTER_APPS_RECENT = 2;
|
||||
public static final int FILTER_APPS_FREQUENT = 3;
|
||||
public static final int FILTER_APPS_ALL = 4;
|
||||
@@ -82,20 +82,20 @@ public class AppFilterRegistry {
|
||||
private AppFilterRegistry() {
|
||||
mFilters = new AppFilterItem[18];
|
||||
|
||||
// High power whitelist, on
|
||||
mFilters[FILTER_APPS_POWER_WHITELIST] = new AppFilterItem(
|
||||
// High power allowlist, on
|
||||
mFilters[FILTER_APPS_POWER_ALLOWLIST] = new AppFilterItem(
|
||||
new ApplicationsState.CompoundFilter(
|
||||
AppStatePowerBridge.FILTER_POWER_WHITELISTED,
|
||||
AppStatePowerBridge.FILTER_POWER_ALLOWLISTED,
|
||||
ApplicationsState.FILTER_ALL_ENABLED),
|
||||
FILTER_APPS_POWER_WHITELIST,
|
||||
FILTER_APPS_POWER_ALLOWLIST,
|
||||
R.string.high_power_filter_on);
|
||||
|
||||
// Without disabled until used
|
||||
mFilters[FILTER_APPS_POWER_WHITELIST_ALL] = new AppFilterItem(
|
||||
mFilters[FILTER_APPS_POWER_ALLOWLIST_ALL] = new AppFilterItem(
|
||||
new ApplicationsState.CompoundFilter(
|
||||
ApplicationsState.FILTER_WITHOUT_DISABLED_UNTIL_USED,
|
||||
ApplicationsState.FILTER_ALL_ENABLED),
|
||||
FILTER_APPS_POWER_WHITELIST_ALL,
|
||||
FILTER_APPS_POWER_ALLOWLIST_ALL,
|
||||
R.string.filter_all_apps);
|
||||
|
||||
// All apps
|
||||
@@ -200,7 +200,7 @@ public class AppFilterRegistry {
|
||||
case ManageApplications.LIST_TYPE_USAGE_ACCESS:
|
||||
return FILTER_APPS_USAGE_ACCESS;
|
||||
case ManageApplications.LIST_TYPE_HIGH_POWER:
|
||||
return FILTER_APPS_POWER_WHITELIST;
|
||||
return FILTER_APPS_POWER_ALLOWLIST;
|
||||
case ManageApplications.LIST_TYPE_OVERLAY:
|
||||
return FILTER_APPS_WITH_OVERLAY;
|
||||
case ManageApplications.LIST_TYPE_WRITE_SETTINGS:
|
||||
|
@@ -25,8 +25,8 @@ import static com.android.settings.applications.manageapplications.AppFilterRegi
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_FREQUENT;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_INSTANT;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_PERSONAL;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_WHITELIST;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_WHITELIST_ALL;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_ALLOWLIST;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_ALLOWLIST_ALL;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_RECENT;
|
||||
import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_WORK;
|
||||
import static com.android.settings.search.actionbar.SearchMenuController.MENU_SEARCH;
|
||||
@@ -125,7 +125,7 @@ import com.android.settingslib.applications.ApplicationsState.AppFilter;
|
||||
import com.android.settingslib.applications.ApplicationsState.CompoundFilter;
|
||||
import com.android.settingslib.applications.ApplicationsState.VolumeFilter;
|
||||
import com.android.settingslib.applications.StorageStatsSource;
|
||||
import com.android.settingslib.fuelgauge.PowerWhitelistBackend;
|
||||
import com.android.settingslib.fuelgauge.PowerAllowlistBackend;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
import com.android.settingslib.widget.settingsspinner.SettingsSpinnerAdapter;
|
||||
|
||||
@@ -479,7 +479,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_ALL);
|
||||
}
|
||||
if (mListType == LIST_TYPE_HIGH_POWER) {
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_POWER_WHITELIST_ALL);
|
||||
mFilterAdapter.enableFilter(FILTER_APPS_POWER_ALLOWLIST_ALL);
|
||||
}
|
||||
|
||||
setCompositeFilter();
|
||||
@@ -1011,7 +1011,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
private boolean mHasReceivedBridgeCallback;
|
||||
private FileViewHolderController mExtraViewController;
|
||||
private SearchFilter mSearchFilter;
|
||||
private PowerWhitelistBackend mBackend;
|
||||
private PowerAllowlistBackend mBackend;
|
||||
|
||||
// This is to remember and restore the last scroll position when this
|
||||
// fragment is paused. We need this special handling because app entries are added gradually
|
||||
@@ -1036,7 +1036,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
mContext = manageApplications.getActivity();
|
||||
mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
|
||||
mAppFilter = appFilter;
|
||||
mBackend = PowerWhitelistBackend.getInstance(mContext);
|
||||
mBackend = PowerAllowlistBackend.getInstance(mContext);
|
||||
if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) {
|
||||
mExtraInfoBridge = new AppStateNotificationBridge(mContext, mState, this,
|
||||
manageApplications.mUsageStatsManager,
|
||||
@@ -1292,8 +1292,8 @@ public class ManageApplications extends InstrumentedFragment
|
||||
Log.d(TAG, "onRebuildComplete size=" + entries.size());
|
||||
}
|
||||
final int filterType = mAppFilter.getFilterType();
|
||||
if (filterType == FILTER_APPS_POWER_WHITELIST ||
|
||||
filterType == FILTER_APPS_POWER_WHITELIST_ALL) {
|
||||
if (filterType == FILTER_APPS_POWER_ALLOWLIST
|
||||
|| filterType == FILTER_APPS_POWER_ALLOWLIST_ALL) {
|
||||
entries = removeDuplicateIgnoringUser(entries);
|
||||
}
|
||||
mEntries = entries;
|
||||
@@ -1451,7 +1451,7 @@ public class ManageApplications extends InstrumentedFragment
|
||||
}
|
||||
ApplicationsState.AppEntry entry = mEntries.get(position);
|
||||
|
||||
return !mBackend.isSysWhitelisted(entry.info.packageName)
|
||||
return !mBackend.isSysAllowlisted(entry.info.packageName)
|
||||
&& !mBackend.isDefaultActiveApp(entry.info.packageName);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user