美文网首页蓝牙
定位服务关闭时,后台无法扫描蓝牙

定位服务关闭时,后台无法扫描蓝牙

作者: 冰珊孤雪 | 来源:发表于2019-07-30 10:37 被阅读0次

Cannot start unfiltered scan in location-off. This scan will be resumed when location is on: 5

搜索蓝牙接口:

/android/platform/packages/apps/Bluetooth/src/com/android/bluetooth/gatt/ScanManager.java

void handleStartScan(ScanClient client) {
            ...
            final boolean locationEnabled = mLocationManager.isLocationEnabled();
            if (!locationEnabled && !isFiltered) {
                Log.i(TAG, "Cannot start unfiltered scan in location-off. This scan will be"
                        + " resumed when location is on: " + client.scannerId);
                mSuspendedScanClients.add(client);
                if (client.stats != null) {
                    client.stats.recordScanSuspend(client.scannerId);
                }
                return;
            }

            ...
        }

相关文章

网友评论

    本文标题:定位服务关闭时,后台无法扫描蓝牙

    本文链接:https://www.haomeiwen.com/subject/jzdgrctx.html