[Wi-Fi] Remove redundant code in WifiSettings2
WifiPickerTracker get WifiEntries at onStart, it's no meaning to getWifiEntry at WifiSettings2#onActivityCreated. Bug: 143328194 Test: manual Edit a Wi-Fi network by clicking context menu 'Modify', rotate the WiFiDialog and see if any thing wrong Change-Id: I9746879720b72723259e1b59e8b5e8bae183b8cc
This commit is contained in:
@@ -326,18 +326,6 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
if (savedInstanceState != null) {
|
||||
mDialogMode = savedInstanceState.getInt(SAVE_DIALOG_MODE);
|
||||
mDialogWifiEntryKey = savedInstanceState.getString(SAVE_DIALOG_WIFIENTRY_KEY);
|
||||
|
||||
if (!TextUtils.isEmpty(mDialogWifiEntryKey)) {
|
||||
List<WifiEntry> wifiEntries = mWifiPickerTracker.getWifiEntries();
|
||||
Optional<WifiEntry> matchedWifiEntry = wifiEntries.stream().filter(wifiEntry ->
|
||||
TextUtils.equals(wifiEntry.getKey(), mDialogWifiEntryKey)).findAny();
|
||||
if (matchedWifiEntry.isPresent()) {
|
||||
mDialogWifiEntry = matchedWifiEntry.get();
|
||||
} else {
|
||||
throw new IllegalStateException("Failed to restore WifiEntry of key: "
|
||||
+ mDialogWifiEntryKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we're supposed to enable/disable the Next button based on our current connection
|
||||
|
Reference in New Issue
Block a user