[Wi-Fi] WiFi Settings inclusive language fix plan phase 1

Replace WiFi related terms which contain Master wording.
Goal: Create a fixit for Android Platform to reduce the use of non-inclusive language for all code.

Bug: 161425297
Test: make RunSettingsRoboTests -j or
make RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=WirelessDebuggingPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagementSwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=TopLevelNetworkEntryPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=PrimarySwitchPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiPrimarySwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest

Change-Id: I9395c50e092e124016609f88f7c8151554a0d874
This commit is contained in:
govenliu
2020-07-16 17:09:03 +08:00
parent 670d37c44e
commit b70ddb9df7
29 changed files with 119 additions and 108 deletions

View File

@@ -23,17 +23,17 @@ import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
/*
* The switch controller that is used to update the switch widget in the MasterSwitchPreference
/**
* The switch controller that is used to update the switch widget in the PrimarySwitchPreference
* layout.
*/
public class MasterSwitchController extends SwitchWidgetController implements
Preference.OnPreferenceChangeListener {
public class PrimarySwitchController extends SwitchWidgetController implements
Preference.OnPreferenceChangeListener {
private final MasterSwitchPreference mPreference;
private final PrimarySwitchPreference mPreference;
private final MetricsFeatureProvider mMetricsFeatureProvider;
public MasterSwitchController(MasterSwitchPreference preference) {
public PrimarySwitchController(PrimarySwitchPreference preference) {
mPreference = preference;
mMetricsFeatureProvider = FeatureFactory.getFactory(preference.getContext())
.getMetricsFeatureProvider();

View File

@@ -33,27 +33,27 @@ import com.android.settingslib.RestrictedPreference;
* A custom preference that provides inline switch toggle. It has a mandatory field for title, and
* optional fields for icon and sub-text. And it can be restricted by admin state.
*/
public class MasterSwitchPreference extends RestrictedPreference {
public class PrimarySwitchPreference extends RestrictedPreference {
private Switch mSwitch;
private boolean mChecked;
private boolean mCheckedSet;
private boolean mEnableSwitch = true;
public MasterSwitchPreference(Context context, AttributeSet attrs,
public PrimarySwitchPreference(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
public PrimarySwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public MasterSwitchPreference(Context context, AttributeSet attrs) {
public PrimarySwitchPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MasterSwitchPreference(Context context) {
public PrimarySwitchPreference(Context context) {
super(context);
}
@@ -101,6 +101,11 @@ public class MasterSwitchPreference extends RestrictedPreference {
return mSwitch != null && mChecked;
}
/**
* Set the checked status to be {@code checked}.
*
* @param checked The new checked status
*/
public void setChecked(boolean checked) {
// Always set checked the first time; don't assume the field's default of false.
final boolean changed = mChecked != checked;
@@ -113,6 +118,11 @@ public class MasterSwitchPreference extends RestrictedPreference {
}
}
/**
* Set the Switch to be the status of {@code enabled}.
*
* @param enabled The new enabled status
*/
public void setSwitchEnabled(boolean enabled) {
mEnableSwitch = enabled;
if (mSwitch != null) {