Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 204
Sam Avatar asked Mar 23 '18 15:03

Sam


1 Answers

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.

like image 178
tir38 Avatar answered Sep 30 '22 19:09

tir38