Merge "[Wi-Fi] Fix Wi-Fi wrong password notification can't launch editor"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ecebf0ef61
@@ -227,7 +227,12 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
super.onCreate(icicle);
|
||||
|
||||
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SETTINGS_WIFITRACKER2)) {
|
||||
getContext().startActivity(new Intent("android.settings.WIFI_SETTINGS2"));
|
||||
final Intent intent = new Intent("android.settings.WIFI_SETTINGS2");
|
||||
final Bundle extras = getActivity().getIntent().getExtras();
|
||||
if (extras != null) {
|
||||
intent.putExtras(extras);
|
||||
}
|
||||
getContext().startActivity(intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
@@ -393,21 +393,6 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
}
|
||||
|
||||
changeNextButtonState(mWifiPickerTracker.getConnectedWifiEntry() != null);
|
||||
|
||||
// Edit the Wi-Fi network of specified SSID.
|
||||
if (mOpenSsid != null) {
|
||||
Optional<WifiEntry> matchedWifiEntry = mWifiPickerTracker.getWifiEntries().stream()
|
||||
.filter(wifiEntry -> TextUtils.equals(mOpenSsid, wifiEntry.getSsid()))
|
||||
.filter(wifiEntry -> wifiEntry.getSecurity() != WifiEntry.SECURITY_NONE
|
||||
&& wifiEntry.getSecurity() != WifiEntry.SECURITY_OWE)
|
||||
.filter(wifiEntry -> !wifiEntry.isSaved()
|
||||
|| isDisabledByWrongPassword(wifiEntry))
|
||||
.findFirst();
|
||||
if (matchedWifiEntry.isPresent()) {
|
||||
mOpenSsid = null;
|
||||
launchConfigNewNetworkFragment(matchedWifiEntry.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -670,6 +655,21 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
public void onWifiEntriesChanged() {
|
||||
updateWifiEntryPreferencesDelayed();
|
||||
changeNextButtonState(mWifiPickerTracker.getConnectedWifiEntry() != null);
|
||||
|
||||
// Edit the Wi-Fi network of specified SSID.
|
||||
if (mOpenSsid != null) {
|
||||
Optional<WifiEntry> matchedWifiEntry = mWifiPickerTracker.getWifiEntries().stream()
|
||||
.filter(wifiEntry -> TextUtils.equals(mOpenSsid, wifiEntry.getSsid()))
|
||||
.filter(wifiEntry -> wifiEntry.getSecurity() != WifiEntry.SECURITY_NONE
|
||||
&& wifiEntry.getSecurity() != WifiEntry.SECURITY_OWE)
|
||||
.filter(wifiEntry -> !wifiEntry.isSaved()
|
||||
|| isDisabledByWrongPassword(wifiEntry))
|
||||
.findFirst();
|
||||
if (matchedWifiEntry.isPresent()) {
|
||||
mOpenSsid = null;
|
||||
launchConfigNewNetworkFragment(matchedWifiEntry.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user