Search code examples
androidandroid-source

How do I set the default properties in an AOSP build?


Where can I change the default Android device properties in my custom AOSP build?

For example:

  • GPS - ON;
  • Sync - ON;
  • Brightness - AUTO;
  • Bluetooth - OFF;
  • WiFi - OFF;
  • Sound - default sound;
  • Vibrate when ring - OFF;

These settings should be defined in the build so they are already in their correct state once build is loaded.

Is there a centralized file/folder for all the settings? Or a Settings application that gathers by itself settings from all Android platform modules?


Solution

  • There are two main places I usually check for defaults:

    /frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    

    and:

    /frameworks/base/core/res/res/values/config.xml
    

    Its also worth checking the device directory for overlays which just override the original files:

    /device/<company-name>/<product-name>/overlay/frameworks/base/core/res/res/values/config.xml
    

    Default wallpaper usually hardcoded to:

    /frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg
    

    Default volume levels for various streams(int[] DEFAULT_STREAM_VOLUME):

    /frameworks/base/media/java/android/media/AudioSystem.java