[WifiSettings2] Remove redundant save() call for new configs
Removing call to WifiManager#save() when configuring a new network through tapping it in the wifi picker. Since WifiManager#connect() already saves the passed in WifiConfiguration, the call to WifiManager#save() is redundant. Bug: 149579116 Test: build, manual verification by connecting to a new secure network Change-Id: I9242e7fd7e9a459e8221b6bb491ab67833970e87
This commit is contained in:
@@ -423,8 +423,8 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
|||||||
final WifiConfiguration wifiConfiguration = data.getParcelableExtra(
|
final WifiConfiguration wifiConfiguration = data.getParcelableExtra(
|
||||||
ConfigureWifiEntryFragment.NETWORK_CONFIG_KEY);
|
ConfigureWifiEntryFragment.NETWORK_CONFIG_KEY);
|
||||||
if (wifiConfiguration != null) {
|
if (wifiConfiguration != null) {
|
||||||
mWifiManager.save(wifiConfiguration,
|
mWifiManager.connect(wifiConfiguration,
|
||||||
new WifiSaveThenConnectActionListener(wifiConfiguration));
|
new WifiConnectActionListener());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -970,29 +970,6 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
|||||||
fullScreenEdit));
|
fullScreenEdit));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class WifiSaveThenConnectActionListener implements WifiManager.ActionListener {
|
|
||||||
final WifiConfiguration mWifiConfiguration;
|
|
||||||
|
|
||||||
WifiSaveThenConnectActionListener(WifiConfiguration wifiConfiguration) {
|
|
||||||
mWifiConfiguration = wifiConfiguration;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
mWifiManager.connect(mWifiConfiguration, new WifiConnectActionListener());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(int reason) {
|
|
||||||
final Activity activity = getActivity();
|
|
||||||
if (isFisishingOrDestroyed(activity)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Toast.makeText(activity, R.string.wifi_failed_save_message, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private class WifiConnectActionListener implements WifiManager.ActionListener {
|
private class WifiConnectActionListener implements WifiManager.ActionListener {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
Reference in New Issue
Block a user