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

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;
            }

            ...
        }

你可能感兴趣的:(定位服务关闭时,后台无法扫描蓝牙)