• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Why does Google block Bluetooth battery level in Settings?

Search This thread

Renate

Inactive Recognized Dev / Recognized Contributor
Feb 3, 2012
2,916
1,286
Boston
Nexus 7 (2013)
Moto E5
I have multiple Androids with Bluetooth, 8, 9, 10.
I have multiple commercial Bluetooth devices, keyboard, heart monitor.
I have multiple homemade Bluetooth devices.
I can read battery level just fine by rolling my own app and reading GATT service 0x180f, characteristic 0x2a19.
I have never seen battery level under Settings.apk, "Device details" for anything.

No, I don't want an app or a battery icon on the status bar. I'd just like the battery level to be there in Settings.

I did a quick dive in Settings.apk and I see that the sub-layout is advanced_bt_entity_sub.xml
The code is in com.android.settings.bluetooth.AdvancedBluetoothDetailsHeaderController
In updateSubLayout() there is a bunch of stuff about "untethered headsets".

Am I missing something? Is there something to be enabled? Did Google lock this down for non-headsets? Should I keep diving?

Edit: I just remembered that I did have a pair of Bluetooth headphones. I paired them and the battery level popped up. Unless you have "Phone calls" enabled you don't get to see the battery. What kind of stupidity is this?
 
Last edited:

Renate

Inactive Recognized Dev / Recognized Contributor
Feb 3, 2012
2,916
1,286
Boston
Nexus 7 (2013)
Moto E5
"settings_ui/bt_advanced_header_enabled" is used in the config settings (but not present), but the default on query is true anyway.

Edit: Oops, the "namespace" is not bluetooth.
 
Last edited: