Merge "Stop expecting WifiConfig extra from CONFIGURED_NETWORKS_CHANGED_ACTION broadcast" into rvc-dev am: 15d4970c9d
am: 46a4938667
am: cebaf44767
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11923937 Change-Id: Ib0f108aec47666477aa022aa2f410f06d752511f
This commit is contained in:
@@ -214,15 +214,7 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION:
|
||||
if (!intent.getBooleanExtra(WifiManager.EXTRA_MULTIPLE_NETWORKS_CHANGED,
|
||||
false /* defaultValue */)) {
|
||||
// only one network changed
|
||||
WifiConfiguration wifiConfiguration = intent
|
||||
.getParcelableExtra(WifiManager.EXTRA_WIFI_CONFIGURATION);
|
||||
if (mAccessPoint.matches(wifiConfiguration)) {
|
||||
mWifiConfig = wifiConfiguration;
|
||||
}
|
||||
}
|
||||
updateMatchingWifiConfig();
|
||||
// fall through
|
||||
case WifiManager.NETWORK_STATE_CHANGED_ACTION:
|
||||
case WifiManager.RSSI_CHANGED_ACTION:
|
||||
@@ -230,6 +222,17 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMatchingWifiConfig() {
|
||||
// use getPrivilegedConfiguredNetworks() to get Passpoint & other ephemeral networks
|
||||
for (WifiConfiguration wifiConfiguration :
|
||||
mWifiManager.getPrivilegedConfiguredNetworks()) {
|
||||
if (mAccessPoint.matches(wifiConfiguration)) {
|
||||
mWifiConfig = wifiConfiguration;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final NetworkRequest mNetworkRequest = new NetworkRequest.Builder()
|
||||
|
Reference in New Issue
Block a user