how to permanently enable bluetooth in the default settings

986 views
Skip to first unread message

Abhay Ghatpande

unread,
Oct 17, 2013, 6:05:19 PM10/17/13
to android-...@googlegroups.com
Hello all,

We are building the AOSP image and would permanently like to enable some settings in the build because the user will not have access to the settings UI. (The device will be running a custom application always.)

For example BT connectivity should be always enabled, brightness settings, etc.

I am wondering where the default settings for a device are stored and how we can modify them.

Thanks for your help.

Abhay

Roger Chen

unread,
Oct 22, 2013, 4:55:25 AM10/22/13
to android-...@googlegroups.com
How about setting the default value to true to make bluetooth enable all the time?
You can do this by modifying Settings.

Abhay Ghatpande

unread,
Oct 23, 2013, 1:27:15 AM10/23/13
to android-...@googlegroups.com
Hi Roger,

Can you give me some more details please? Modify which settings? Which files are they defined in? Remember that I wan to build Android with the settings enabled, I cannot use the Android settings UI. Or are you suggesting to enable the settings in my app using the Android settings API?

Thanks,

Abhay

Benoit Fouet

unread,
Oct 23, 2013, 4:59:47 AM10/23/13
to android-...@googlegroups.com, Roger Chen, Abhay Ghatpande
Hi,

IMHO, what you should do is find, where available, the default value
that is set in the settings database.
For instance, the default value for bluetooth enablement can be found in
frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
<bool name="def_bluetooth_on">false</bool>

The "right" way to change that is by overriding the entry in the overlay
part of your device tree:
DEVICE_PACKAGE_OVERLAYS/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

The brightness settings happens to be at the same place.

In the end, the overlay files should only contain the values you want to
override. The build system will take care of overriding the values you
override, while keeping the ones you don't touch.

Ben

Abhay Ghatpande

unread,
Oct 23, 2013, 3:49:10 PM10/23/13
to Benoit Fouet, android-...@googlegroups.com, Roger Chen
Merci Benoit.

Will give it a try.
Reply all
Reply to author
Forward
0 new messages