Merge "Create new WifiEntryPreference if WifiEntry object changes" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-27 03:46:25 +00:00
committed by Android (Google) Code Review

View File

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