Android 5 static bluetooth MAC address for BLE advertising

MStone picture MStone · Feb 19, 2015 · Viewed 9k times · Source

Android 5 introduces BLE MAC address rotating for increased privacy. Every time when calling BluetoothLeAdvertiser.startAdvertising(), the MAC-address is changed.

Is it possible to disable address rotating, and just use the same MAC address during the entire lifetime of BluetoothLeAdvertiser?

Answer

Bogdan Alexandru picture Bogdan Alexandru · Feb 19, 2015

The MAC Address is a physical address and does not change. In BLE terminology, it is the Public Device Address or BD_ADDR for BR/EDR. I haven't tried it, but reading it with readAddress() should return the same value each time.

What the Android's BLE framework does is NOT use that address when advertising. It rather enables privacy by using Private Resolvable Addresses which may change every few minutes or so but still allow bonded devices to recognize it using the IRK exchanged at bonding.

For obvious privacy reasons, Android's BLE framework does not allow you to set the Controller to use the public address when advertising. So you cannot disable the "address rotating".