Merge "Create new WifiEntryPreference if WifiEntry object changes"

This commit is contained in:
TreeHugger Robot
2020-05-21 05:22:39 +00:00
committed by Android (Google) Code Review

View File

@@ -763,8 +763,13 @@ public class WifiSettings extends RestrictedSettingsFragment
LongPressWifiEntryPreference pref =
(LongPressWifiEntryPreference) getCachedPreference(key);
if (pref != null) {
if (pref.getWifiEntry() == wifiEntry) {
pref.setOrder(index++);
continue;
} else {
// Create a new preference if the underlying WifiEntry object has changed
removePreference(key);
}
}
pref = createLongPressWifiEntryPreference(wifiEntry);