Merge "Register for ACTION_WIFI_SCAN_AVAILABILITY_CHANGED" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-03-25 01:07:11 +00:00
committed by Android (Google) Code Review

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(