Merge "Revert "Modify the privacy controller to be selectable in the next updateState()""

This commit is contained in:
TreeHugger Robot
2020-10-20 03:20:36 +00:00
committed by Android (Google) Code Review
4 changed files with 5 additions and 86 deletions

View File

@@ -255,11 +255,6 @@ public class WifiNetworkDetailsFragment2 extends DashboardFragment implements
* API call for refreshing the preferences in this fragment.
*/
public void refreshPreferences() {
updatePreferenceStates();
displayPreferenceControllers();
}
protected void displayPreferenceControllers() {
final PreferenceScreen screen = getPreferenceScreen();
for (AbstractPreferenceController controller : mControllers) {
// WifiDetailPreferenceController2 gets the callback WifiEntryCallback#onUpdated,

View File

@@ -69,12 +69,12 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
public void updateState(Preference preference) {
final DropDownPreference dropDownPreference = (DropDownPreference) preference;
final int randomizationLevel = getRandomizationValue();
final boolean isSelectable = mWifiEntry.canSetPrivacy();
preference.setSelectable(isSelectable);
dropDownPreference.setValue(Integer.toString(randomizationLevel));
if (isSelectable) {
updateSummary(dropDownPreference, randomizationLevel);
} else {
updateSummary(dropDownPreference, randomizationLevel);
// Makes preference not selectable, when this is a ephemeral network.
if (!mWifiEntry.canSetPrivacy()) {
preference.setSelectable(false);
dropDownPreference.setSummary(R.string.wifi_privacy_settings_ephemeral_summary);
}
}