简体   繁体   中英

Bluetooth scanning works without bluetooth turned on android

I am creating an app with Bluetooth Low energy. There is one interesting thing I found out. I know that for API level 23 or higher you need to give permissions for location in addition to bluetooth for the scanning to work. But I didn't know you could scan for ble devices even when the bluetooth is turned off from settings. I had bluetooth turned off(but location was still on) but I could still see ble devices from scan result.

Is this a bug in android, where android internally uses bluetooth without the user being aware of it ? or is this documented somewhere which I couldn't find.

No. This is completely normal. In Android M they adjusted the permissions / added the feature to use Bluetooth for location. For this to work your phone only needs to listen for other BT devices. It doesn't need to broadcast itself. This is a much smaller privacy concern since you aren't leaking your own presence to other BT devices.

You can read more about it here on Android Police

I'll admit that the user-facing description is weird: "...scan for bluetooth devices, even when Bluetooth is off." Obviously the BT antenna isn't really off. It has to be on to listen for other BT devices. But at a software level, the BT stack is not broadcasting its own address.

It's not clear if or how much this saves battery life since the BT antenna is still on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM