Fix issue where connected network sometimes doesn't update.
Ensures that the connected network Preference and WifiTracker have the same reference so that updates to one propagate to the other. Bug: 64124982 Test: manual Change-Id: I1b838b1cf65da1b5aebf4f5f37f0df0c5e473dba
This commit is contained in:
@@ -857,10 +857,11 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
}
|
||||
|
||||
// Is the previous currently connected SSID different from the new one?
|
||||
if (!((AccessPointPreference)
|
||||
mConnectedAccessPointPreferenceCategory.getPreference(0))
|
||||
.getAccessPoint().getSsidStr().equals(
|
||||
connectedAp.getSsidStr())) {
|
||||
AccessPointPreference preference = (AccessPointPreference)
|
||||
(mConnectedAccessPointPreferenceCategory.getPreference(0));
|
||||
// The AccessPoints need to be the same reference to ensure that updates are reflected
|
||||
// in the UI.
|
||||
if (preference.getAccessPoint() != connectedAp) {
|
||||
removeConnectedAccessPointPreference();
|
||||
addConnectedAccessPointPreference(connectedAp);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user