Merge "[Wi-Fi] Remove redundant code in WifiSettings2"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7a3ed0ecea
@@ -326,18 +326,6 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
|||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
mDialogMode = savedInstanceState.getInt(SAVE_DIALOG_MODE);
|
mDialogMode = savedInstanceState.getInt(SAVE_DIALOG_MODE);
|
||||||
mDialogWifiEntryKey = savedInstanceState.getString(SAVE_DIALOG_WIFIENTRY_KEY);
|
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
|
// If we're supposed to enable/disable the Next button based on our current connection
|
||||||
|
Reference in New Issue
Block a user