Fix Passpoint network details privacy and ssid
Allow changing the privacy setting for Passpoint networks, which are considered subscriptions but not saved networks. Also use getSsid() for the SSID pref. Bug: 70983952 Test: manual build and visual verification Change-Id: I8a4309421b28bccaf2bd62a23dca8cef133d5af1
This commit is contained in:
@@ -623,9 +623,9 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
|
||||
}
|
||||
|
||||
private void refreshSsid() {
|
||||
if (mWifiEntry.isSubscription()) {
|
||||
if (mWifiEntry.isSubscription() && mWifiEntry.getSsid() != null) {
|
||||
mSsidPref.setVisible(true);
|
||||
mSsidPref.setSummary(mWifiEntry.getTitle());
|
||||
mSsidPref.setSummary(mWifiEntry.getSsid());
|
||||
} else {
|
||||
mSsidPref.setVisible(false);
|
||||
}
|
||||
|
@@ -82,14 +82,13 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
final int privacy = Integer.parseInt((String) newValue);
|
||||
if (mWifiEntry.isSaved()) {
|
||||
mWifiEntry.setPrivacy(privacy);
|
||||
|
||||
// To activate changing, we need to reconnect network. WiFi will auto connect to
|
||||
// current network after disconnect(). Only needed when this is connected network.
|
||||
if (mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED) {
|
||||
mWifiEntry.disconnect(null /* callback */);
|
||||
}
|
||||
mWifiEntry.connect(null /* callback */);
|
||||
}
|
||||
updateSummary((DropDownPreference) preference, privacy);
|
||||
return true;
|
||||
@@ -97,11 +96,8 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
||||
|
||||
@VisibleForTesting
|
||||
int getRandomizationValue() {
|
||||
if (mWifiEntry.isSaved()) {
|
||||
return mWifiEntry.getPrivacy();
|
||||
}
|
||||
return WifiEntry.PRIVACY_RANDOMIZED_MAC;
|
||||
}
|
||||
|
||||
private static final int PREF_RANDOMIZATION_PERSISTENT = 0;
|
||||
private static final int PREF_RANDOMIZATION_NONE = 1;
|
||||
@@ -138,12 +134,11 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
||||
public void onSubmit(WifiDialog2 dialog) {
|
||||
if (dialog.getController() != null) {
|
||||
final WifiConfiguration newConfig = dialog.getController().getConfig();
|
||||
if (newConfig == null || !mWifiEntry.isSaved()) {
|
||||
if (newConfig == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newConfig.macRandomizationSetting
|
||||
!= mWifiEntry.getWifiConfiguration().macRandomizationSetting) {
|
||||
if (getWifiEntryPrivacy(newConfig) != mWifiEntry.getPrivacy()) {
|
||||
mWifiEntry.setPrivacy(getWifiEntryPrivacy(newConfig));
|
||||
onPreferenceChange(mPreference, String.valueOf(newConfig.macRandomizationSetting));
|
||||
}
|
||||
|
Reference in New Issue
Block a user