Merge "Fix Passpoint network details privacy and ssid" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
56fb482acf
@@ -624,9 +624,9 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshSsid() {
|
private void refreshSsid() {
|
||||||
if (mWifiEntry.isSubscription()) {
|
if (mWifiEntry.isSubscription() && mWifiEntry.getSsid() != null) {
|
||||||
mSsidPref.setVisible(true);
|
mSsidPref.setVisible(true);
|
||||||
mSsidPref.setSummary(mWifiEntry.getTitle());
|
mSsidPref.setSummary(mWifiEntry.getSsid());
|
||||||
} else {
|
} else {
|
||||||
mSsidPref.setVisible(false);
|
mSsidPref.setVisible(false);
|
||||||
}
|
}
|
||||||
|
@@ -82,14 +82,13 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
|||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
final int privacy = Integer.parseInt((String) newValue);
|
final int privacy = Integer.parseInt((String) newValue);
|
||||||
if (mWifiEntry.isSaved()) {
|
mWifiEntry.setPrivacy(privacy);
|
||||||
mWifiEntry.setPrivacy(privacy);
|
|
||||||
|
|
||||||
// To activate changing, we need to reconnect network. WiFi will auto connect to
|
// To activate changing, we need to reconnect network. WiFi will auto connect to
|
||||||
// current network after disconnect(). Only needed when this is connected network.
|
// current network after disconnect(). Only needed when this is connected network.
|
||||||
if (mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED) {
|
if (mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED) {
|
||||||
mWifiEntry.disconnect(null /* callback */);
|
mWifiEntry.disconnect(null /* callback */);
|
||||||
}
|
mWifiEntry.connect(null /* callback */);
|
||||||
}
|
}
|
||||||
updateSummary((DropDownPreference) preference, privacy);
|
updateSummary((DropDownPreference) preference, privacy);
|
||||||
return true;
|
return true;
|
||||||
@@ -97,10 +96,7 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
int getRandomizationValue() {
|
int getRandomizationValue() {
|
||||||
if (mWifiEntry.isSaved()) {
|
return mWifiEntry.getPrivacy();
|
||||||
return mWifiEntry.getPrivacy();
|
|
||||||
}
|
|
||||||
return WifiEntry.PRIVACY_RANDOMIZED_MAC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int PREF_RANDOMIZATION_PERSISTENT = 0;
|
private static final int PREF_RANDOMIZATION_PERSISTENT = 0;
|
||||||
@@ -138,12 +134,11 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
|
|||||||
public void onSubmit(WifiDialog2 dialog) {
|
public void onSubmit(WifiDialog2 dialog) {
|
||||||
if (dialog.getController() != null) {
|
if (dialog.getController() != null) {
|
||||||
final WifiConfiguration newConfig = dialog.getController().getConfig();
|
final WifiConfiguration newConfig = dialog.getController().getConfig();
|
||||||
if (newConfig == null || !mWifiEntry.isSaved()) {
|
if (newConfig == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newConfig.macRandomizationSetting
|
if (getWifiEntryPrivacy(newConfig) != mWifiEntry.getPrivacy()) {
|
||||||
!= mWifiEntry.getWifiConfiguration().macRandomizationSetting) {
|
|
||||||
mWifiEntry.setPrivacy(getWifiEntryPrivacy(newConfig));
|
mWifiEntry.setPrivacy(getWifiEntryPrivacy(newConfig));
|
||||||
onPreferenceChange(mPreference, String.valueOf(newConfig.macRandomizationSetting));
|
onPreferenceChange(mPreference, String.valueOf(newConfig.macRandomizationSetting));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user