android default setting

Android : 2017.07.24 10:02

출처 :https://stackoverflow.com/questions/16770639/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?






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








diff --git a/api/current.txt b/api/current.txt

index 39d8bfc..1228985 100644

--- a/api/current.txt

+++ b/api/current.txt

@@ -17,6 +17,7 @@ package android {

     field public static final java.lang.String ACCOUNT_MANAGER = "android.permission.ACCOUNT_MANAGER";

     field public static final java.lang.String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";

     field public static final java.lang.String AUTHENTICATE_ACCOUNTS = "android.permission.AUTHENTICATE_ACCOUNTS";

+    field public static final java.lang.String BACKUP = "android.permission.BACKUP";

     field public static final java.lang.String BATTERY_STATS = "android.permission.BATTERY_STATS";

     field public static final java.lang.String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";

     field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";

@@ -78,6 +79,7 @@ package android {

     field public static final java.lang.String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT";

     field public static final java.lang.String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW";

     field public static final java.lang.String INTERNET = "android.permission.INTERNET";

+    field public static final java.lang.String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";

     field public static final java.lang.String KILL_BACKGROUND_PROCESSES = "android.permission.KILL_BACKGROUND_PROCESSES";

     field public static final java.lang.String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";

     field public static final java.lang.String MANAGE_ACCOUNTS = "android.permission.MANAGE_ACCOUNTS";

@@ -101,6 +103,7 @@ package android {

     field public static final deprecated java.lang.String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";

     field public static final java.lang.String READ_LOGS = "android.permission.READ_LOGS";

     field public static final java.lang.String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE";

+    field public static final java.lang.String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";

     field public static final java.lang.String READ_PROFILE = "android.permission.READ_PROFILE";

     field public static final java.lang.String READ_SMS = "android.permission.READ_SMS";

     field public static final deprecated java.lang.String READ_SOCIAL_STREAM = "android.permission.READ_SOCIAL_STREAM";

@@ -110,6 +113,7 @@ package android {

     field public static final java.lang.String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";

     field public static final java.lang.String REBOOT = "android.permission.REBOOT";

     field public static final java.lang.String RECEIVE_BOOT_COMPLETED = "android.permission.RECEIVE_BOOT_COMPLETED";

+    field public static final java.lang.String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";

     field public static final java.lang.String RECEIVE_MMS = "android.permission.RECEIVE_MMS";

     field public static final java.lang.String RECEIVE_SMS = "android.permission.RECEIVE_SMS";

     field public static final java.lang.String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";

diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml

index 16c6075..6246b43 100644

--- a/packages/SettingsProvider/res/values/defaults.xml

+++ b/packages/SettingsProvider/res/values/defaults.xml

@@ -36,7 +36,7 @@

     <bool name="def_haptic_feedback">true</bool>

 

     <bool name="def_bluetooth_on">false</bool>

-    <bool name="def_wifi_display_on">false</bool>

+    <bool name="def_wifi_display_on">true</bool>

     <bool name="def_install_non_market_apps">false</bool>

     <bool name="def_package_verifier_enable">true</bool>

     <!-- Comma-separated list of location providers.

@@ -47,7 +47,7 @@

     <bool name="assisted_gps_enabled">true</bool>

     <bool name="def_netstats_enabled">true</bool>

     <bool name="def_usb_mass_storage_enabled">true</bool>

-    <bool name="def_wifi_on">false</bool>

+    <bool name="def_wifi_on">true</bool>

     <!-- 0 == never, 1 == only when plugged in, 2 == always -->

     <integer name="def_wifi_sleep_policy">2</integer>

     <bool name="def_networks_available_notification_on">true</bool>

@@ -184,7 +184,7 @@

     <string name="def_immersive_mode_confirmations" translatable="false"></string>

 

     <!-- Default for Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE -->

-    <integer name="def_wifi_scan_always_available">0</integer>

+    <integer name="def_wifi_scan_always_available">1</integer>

 

     <!-- Default for Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1==on -->

     <integer name="def_lock_screen_show_notifications">1</integer>



Posted by Real_G