Android7.1.1 system setting default value Daquan
Judgment condition:
The default value can be found only after the switch state is still saved after reboot or the switch state is restored to the default after reset (restore to factory settings) .
The switch state is still preserved after reboot, indicating that the state is stored in the db.
After reset, the switch state is restored to the default, indicating that the state has a default value.
For example, like wiif switch, bluetooth switch, gps switch, etc., there are default values, and the state values are saved in db.
As for the WiFi hotspot switch, the state is not saved after reboot, so don't waste your efforts to find his default value or state storage value
2 Modify the default value
Most of the switch states are stored in the SettingProvider's db, and there are three files related to the state value
- /frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java: This file stores state values
- /frameworks/base/packages/SettingsProvider/res/values/defaults.xml: defines the default value of the switch state
- /frameworks/base/core/java/android/provider/Settings.java: defines the corresponding key when the default value of each switch state is stored
What are the default values
value | meaning | key |
---|---|---|
def_dim_screen | 0=no 1=yes: Whether to make the screen brightness gradually dim | Settings.System. DIM_SCREEN |
def_screen_off_timeout | The screen goes off after a few seconds of inactivity | Settings.System. SCREEN_OFF_TIMEOUT |
def_sleep_timeout | How many seconds to sleep after no operation | Settings.Secure. SLEEP_TIMEOUT |
def_airplane_mode_on | Is airplane mode enabled by default? | Settings.Global. AIRPLANE_MODE_ON |
def_theater_mode_on | Whether theater mode is enabled by default | Settings.Global. THEATER_MODE_ON |
def_airplane_mode_radios | List of switches that will be turned off when airplane mode is turned on (usually includes bluetooth, wifi, nfc, etc.) | Settings.Global. AIRPLANE_MODE_RADIOS |
airplane_mode_toggleable_radios | List of switches that users can manually turn on in airplane mode | Settings.Global.AIRPLANE_ MODE_TOGGLEABLE_RADIOS |
def_auto_time | 1=yes, 0=no Whether to automatically synchronize date, time, time zone from the network | Settings.Global. AUTO_TIME |
def_auto_time_zone | 1=yes, 0=no Whether to automatically synchronize the time zone from the network | Settings.Global. AUTO_TIME_ZONE |
def_accelerometer_rotation | 1=yes, 0=no Whether to enable automatic rotation (that is, whether to rotate the screen orientation according to the acceleration sensor) | Settings.System. ACCELEROMETER_ROTATION |
def_screen_brightness | The default brightness of the screen (value range is 0–255) | Settings.System. SCREEN_BRIGHTNESS |
def_screen_brightness _automatic_mode |
Whether to enable automatic adjustment of screen brightness | Settings.System. SCREEN_BRIGHTNESS_MODE |
def_window_animation_scale | 1=yes, 0=no window animation scaling | Settings.System. WINDOW_ANIMATION_SCALE |
def_window_transition_scale | 1=yes, 0=no window transparency | Settings.System. TRANSITION_ANIMATION_SCALE |
def_haptic_feedback | Whether to enable touch feedback, not sure what it means | Settings.System. HAPTIC_FEEDBACK_ENABLED |
def_bluetooth_on | 0=disabled. 1=enabled. Whether to enable Bluetooth by default | Settings.Global. BLUETOOTH_ON |
def_wifi_display_on | 0=disabled. 1=enabled. Whether to enable wifi display | Settings.Global. WIFI_DISPLAY_ON |
def_install_non_market_apps | 是否允许安装不是在应用市场下载的app:1 = 允许通过安装包安装,0 = 不允许通过安装包安装 | Settings.Secure. INSTALL_NON_MARKET_APPS |
def_package_verifier_enable | 在安装app之前进行证书检查,1审查,0不审查 | Settings.Global. PACKAGE_VERIFIER_ENABLE |
def_location_providers_allowed | 是否开启gps,若字符串为null则默认不开启gps,还需借助LOCATION_MODE进行判断 | Settings.Secure. LOCATION_PROVIDERS_ALLOWED |
assisted_gps_enabled | 是否开启辅助的gps应用 | Settings.Global. ASSISTED_GPS_ENABLED |
def_netstats_enabled | 是否开启流量统计 | Settings.Global. NETSTATS_ENABLED |
def_usb_mass_storage_enabled | 是否开启usb海量存储 | Settings.Global. USB_MASS_STORAGE_ENABLED |
def_wifi_on | wifi默认是否开启 | Settings.Global.WIFI_ON |
def_wifi_sleep_policy | wifi是否休眠(会和移动网络来回切换)取值为0-never, 1-only when plugged in, 2-always | Settings.Global.WIFI_SLEEP_POLICY |
def_networks_available_ notification_on |
是否通知用户打开网络 | Settings.Global.WIFI_NETWORKS_ AVAILABLE_NOTIFICATION_ON |
def_backup_enabled | 0-disabled, 1-enabled是否开启设置备份 | Settings.Secure.BACKUP_ENABLED |
def_backup_transport | 用于备份或者恢复的传输文件 | Settings.Secure.BACKUP_TRANSPORT |
def_notification_pulse | 当有通知来时,led灯是否要重复闪烁 | Settings.System.NOTIFICATION_LIGHT_PULSE |
def_mount_play_notification_snd | 当有事件来临时是否播放通知铃声 | Settings.Secure.MOUNT_PLAY_NOTIFICATION_SND |
def_mount_ums_autostart | 是否自动启动主机检测系统 | Settings.Secure.MOUNT_UMS_AUTOSTART |
def_mount_ums_prompt | 是否在主机检测时显示通知 | Settings.Secure.MOUNT_UMS_PROMPT |
def_mount_ums_notify_enabled | Settings.Secure.MOUNT_UMS_NOTIFY_ENABLED | 当开启ums时是否显示通知 |
def_power_sounds_enabled | 电量过低时是否铃声通知 | Settings.Global.POWER_SOUNDS_ENABLED |
def_low_battery_sound | 低电量时播放的铃声文件来源 | Settings.Global.LOW_BATTERY_SOUND |
def_dock_sounds_enabled | 当插拔电源时是否播放声音 | Settings.Global.DOCK_SOUNDS_ENABLED |
def_desk_dock_sound | 插上电源时播放的音频文件 | Settings.Global.DESK_DOCK_SOUND |
def_desk_undock_sound | 拔下电源时播放的音频文件 | Settings.Global.DESK_UNDOCK_SOUND |
def_car_dock_sound | 使用车载电源充电时播放的音频文件 | Settings.Global.CAR_DOCK_SOUND |
def_car_undock_sound | 当从车载电源拔下时播放的音频文件 | Settings.Global.CAR_UNDOCK_SOUND |
def_lockscreen_sounds_enabled | 当解锁或是锁屏时是否播放声音 | Settings.System.LOCKSCREEN_SOUNDS_ENABLED |
def_lock_sound | 锁屏时播放的音频文件 | Settings.Global.LOCK_SOUND |
def_unlock_sound | 解锁时播放的音频文件 | Settings.Global.UNLOCK_SOUND |
def_trusted_sound | 在未解锁的情况下设备进入到可信任状态时播放的音频文件 | Settings.Global.TRUSTED_SOUND |
def_wireless_charging_started_sound | 开启无线充电时播放声音 | Settings.Global.WIRELESS_CHARGING_STARTED_SOUND |
def_lockscreen_disabled | 第一次开机时默认不锁屏(若要彻底去掉锁屏页面还需要在别的方法中设置) | Settings.System.LOCKSCREEN_DISABLED |
def_device_provisioned | 设备是否已经被配置(该参数考虑的时多用户不同时刻使用同一个设备的情况) | Settings.Global.DEVICE_PROVISIONED |
def_dock_audio_media_enabled | 使用dock音频输出媒体 | Settings.Global.DOCK_AUDIO_MEDIA_ENABLED |
def_vibrate_in_silent | 静音模式下是否允许震动 | Settings.System.VIBRATE_IN_SILENT |
def_accessibility_script_injection | 是否增强js的屏幕阅读性 | Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION |
def_accessibility_speak_password | 访问模式下是否语音播报密码 | Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD |
def_low_battery_sound_timeout | 当经过一定时间后,如果低电量提醒为播放声音,则灭屏 | Settings.Global.LOW_BATTERY_SOUND_TIMEOUT |
def_lock_screen_show_notifications | 是否在锁屏界面显示通知 | Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS |
def_lock_screen_allow_private_notifications | 允许在锁屏界面上显示私有通知,就像是解锁状态下一样 | Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS |
def_wifi_scan_always_available | 设置-wlan-高级-随时扫描开关 | Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE |