Merge "Stop expecting WifiConfig extra from CONFIGURED_NETWORKS_CHANGED_ACTION broadcast" into rvc-dev am: 15d4970c9d

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11923937

Change-Id: Ide91f1b4544712f71eb8c1bac843b80bdbdcee49
This commit is contained in:
David Su
2020-06-23 03:20:16 +00:00
committed by Automerger Merge Worker

View File

@@ -214,15 +214,7 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) { switch (intent.getAction()) {
case WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION: case WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION:
if (!intent.getBooleanExtra(WifiManager.EXTRA_MULTIPLE_NETWORKS_CHANGED, updateMatchingWifiConfig();
false /* defaultValue */)) {
// only one network changed
WifiConfiguration wifiConfiguration = intent
.getParcelableExtra(WifiManager.EXTRA_WIFI_CONFIGURATION);
if (mAccessPoint.matches(wifiConfiguration)) {
mWifiConfig = wifiConfiguration;
}
}
// fall through // fall through
case WifiManager.NETWORK_STATE_CHANGED_ACTION: case WifiManager.NETWORK_STATE_CHANGED_ACTION:
case WifiManager.RSSI_CHANGED_ACTION: case WifiManager.RSSI_CHANGED_ACTION:
@@ -230,6 +222,17 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
break; 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() private final NetworkRequest mNetworkRequest = new NetworkRequest.Builder()