[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

@@ -60,7 +60,7 @@ import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.profileselector.ProfileSelectDialog;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.MasterSwitchPreference;
import com.android.settings.widget.PrimarySwitchPreference;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.drawer.ActivityTile;
import com.android.settingslib.drawer.DashboardCategory;
@@ -336,16 +336,16 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
}
private void setSwitchChecked(Preference pref, boolean checked) {
if (pref instanceof MasterSwitchPreference) {
((MasterSwitchPreference) pref).setChecked(checked);
if (pref instanceof PrimarySwitchPreference) {
((PrimarySwitchPreference) pref).setChecked(checked);
} else if (pref instanceof SwitchPreference) {
((SwitchPreference) pref).setChecked(checked);
}
}
private void setSwitchEnabled(Preference pref, boolean enabled) {
if (pref instanceof MasterSwitchPreference) {
((MasterSwitchPreference) pref).setSwitchEnabled(enabled);
if (pref instanceof PrimarySwitchPreference) {
((PrimarySwitchPreference) pref).setSwitchEnabled(enabled);
} else {
pref.setEnabled(enabled);
}

View File

@@ -40,7 +40,7 @@ import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerListHelper;
import com.android.settings.core.SettingsBaseActivity;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.MasterSwitchPreference;
import com.android.settings.widget.PrimarySwitchPreference;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
@@ -530,7 +530,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
return tile instanceof ProviderTile
? new SwitchPreference(getPrefContext())
: tile.hasSwitch()
? new MasterSwitchPreference(getPrefContext())
? new PrimarySwitchPreference(getPrefContext())
: new Preference(getPrefContext());
}