Register for ACTION_WIFI_SCAN_AVAILABILITY_CHANGED

Bug: 183540390
Test: Enable WiFi scan (but not WiFi connectivity), reboot device,
then verify settings are propagated to CHRE.

Change-Id: Ifd282efee97c7f3be90239fea254d92be2b005a5
This commit is contained in:
Arthur Ishiguro
2021-03-24 10:52:33 -07:00
parent ba659c0c51
commit f327582fa1

View File

@@ -259,13 +259,16 @@ public class ContextHubService extends IContextHubService.Stub {
BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction())) {
if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction())
|| WifiManager.ACTION_WIFI_SCAN_AVAILABILITY_CHANGED.equals(
intent.getAction())) {
sendWifiSettingUpdate(false /* forceUpdate */);
}
}
};
IntentFilter filter = new IntentFilter();
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
filter.addAction(WifiManager.ACTION_WIFI_SCAN_AVAILABILITY_CHANGED);
mContext.registerReceiver(wifiReceiver, filter);
mContext.getContentResolver().registerContentObserver(