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

This reverts commit f71149911b.

Reason for revert: Some unexpected code mixed in this CL.

Change-Id: I43574314554a9c62559f529e45f69c29ba6b5a77
This commit is contained in:
Weng Su
2020-10-20 02:12:28 +00:00
parent f71149911b
commit 67f95bfd2f
4 changed files with 5 additions and 86 deletions

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);
}
}