Merge "Update language to comply with Android's inclusive language guidance"
This commit is contained in:
@@ -21,20 +21,20 @@ 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 com.android.settingslib.fuelgauge.PowerWhitelistBackend;
|
||||
import com.android.settingslib.fuelgauge.PowerAllowlistBackend;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Connects data from the PowerWhitelistBackend to ApplicationsState.
|
||||
* Connects data from the PowerAllowlistBackend to ApplicationsState.
|
||||
*/
|
||||
public class AppStatePowerBridge extends AppStateBaseBridge {
|
||||
|
||||
private final PowerWhitelistBackend mBackend;
|
||||
private final PowerAllowlistBackend mBackend;
|
||||
|
||||
public AppStatePowerBridge(Context context, ApplicationsState appState, Callback callback) {
|
||||
super(appState, callback);
|
||||
mBackend = PowerWhitelistBackend.getInstance(context);
|
||||
mBackend = PowerAllowlistBackend.getInstance(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,17 +43,17 @@ public class AppStatePowerBridge extends AppStateBaseBridge {
|
||||
final int N = apps.size();
|
||||
for (int i = 0; i < N; i++) {
|
||||
AppEntry app = apps.get(i);
|
||||
app.extraInfo = mBackend.isWhitelisted(app.info.packageName)
|
||||
app.extraInfo = mBackend.isAllowlisted(app.info.packageName)
|
||||
? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateExtraInfo(AppEntry app, String pkg, int uid) {
|
||||
app.extraInfo = mBackend.isWhitelisted(pkg) ? Boolean.TRUE : Boolean.FALSE;
|
||||
app.extraInfo = mBackend.isAllowlisted(pkg) ? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
|
||||
public static final AppFilter FILTER_POWER_WHITELISTED = new CompoundFilter(
|
||||
public static final AppFilter FILTER_POWER_ALLOWLISTED = new CompoundFilter(
|
||||
ApplicationsState.FILTER_WITHOUT_DISABLED_UNTIL_USED, new AppFilter() {
|
||||
@Override
|
||||
public void init() {
|
||||
|
@@ -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