settingsusage:settings[--userNUM]getnamespacekeysettings[--userNUM]putnamespacekeyvalue'namespace'isoneof{system,secure,global},case-insensitiveIf'--userNUM'isnotgiven,theoperationsareperformedontheowneruser.
1
1、获取值settingsgetsystemnamespacekeysettingsgetglobalnamespacekeysettingsgetsecurenamespacekey设置值settingsputsystemnamespacekeysettingsputglobalnamespacekeysettingsputsecurenamespacekey{system,secure,global}对应的是/data/data/com.android.providers.settings/databases/settings.db的三个表
2、systemsettingsgets鲻戟缒男ystemnamespacekeysettingsputsystemnamespacekeyna罪焐芡拂mespacekey清单如下----------------------------------------------------------------2 airplane_mode_radios cell,bluetooth,wifi,nfc,wimax,ant3 airplane_mode_toggleable_radios bluetooth,wifi,nfc,ant7 stay_on_while_plugged_in 08 wifi_sleep_policy 212 wifi_networks_available_notification_on 114 cdma_cell_broadcast_sms 115 data_roaming 018 mobile_data0 119 data_roaming0 020 mobile_data1 121 data_roaming1 022 mobile_data2 123 data_roaming2 024 netstats_enabled 126 usb_mass_storage_enabled 127 wifi_max_dhcp_retry_count 928 wifi_display_on 029 lock_sound /system/media/audio/ui/Lock.ogg30 unlock_sound /system/media/audio/ui/Unlock.ogg31 power_sounds_enabled 132 low_battery_sound /system/media/audio/ui/LowBattery.ogg34 desk_dock_sound /system/media/audio/ui/Dock.ogg35 desk_undock_sound /system/media/audio/ui/Undock.ogg36 car_dock_sound /system/media/audio/ui/Dock.ogg37 car_undock_sound /system/media/audio/ui/Undock.ogg38 wireless_charging_started_sound /system/media/audio/ui/WirelessChargingStarted.ogg39 dock_audio_media_enabled 141 power_notifications_vibrate 042 power_notifications_ringtone content://settings/system/notification_sound43 set_install_location 044 default_install_location 046 call_auto_retry 047 preferred_network_mode 748 subscription_mode 149 low_battery_sound_timeout 051 wifi_suspend_optimizations_enabled 152 send_action_app_error 053 window_animation_scale 1.054 transition_animation_scale 1.055 animator_duration_scale 1.057 wifi_watchdog_on 158 adb_enabled 161 device_provisioned 163 development_settings_enabled 164 install_non_market_apps 166 mobile_data 075 bluetooth_input_device_priority_C8:FF:28:2C:31:BA -176 bluetooth_a2dp_sink_priority_C8:FF:28:2C:31:BA -177 bluetooth_headset_priority_C8:FF:28:2C:31:BA -178 bluetooth_input_device_priority_30:22:03:03:90:66 10082 bluetooth_headset_priority_30:22:03:03:90:66 100083 bluetooth_last_connected_a2dp_sep_type_30:22:03:03:90:66 284 bluetooth_a2dp_sink_priority_30:22:03:03:90:66 1000188 always_finish_activities 0199 bluetooth_input_device_priority_D4:6E:5C:E7:9D:30 100200 bluetooth_a2dp_sink_priority_D4:6E:5C:E7:9D:30 100201 bluetooth_headset_priority_D4:6E:5C:E7:9D:30 100204 power_notifications_enabled 1205 emergency_tone 1267 auto_time 1268 auto_time_zone 1269 wifi_display_certification_on 1273 bluetooth_input_device_priority_74:A5:28:B1:96:58 -1274 bluetooth_a2dp_sink_priority_74:A5:28:B1:96:58 -1275 bluetooth_headset_priority_74:A5:28:B1:96:58 -1276 bluetooth_on 0319 audio_safe_volume_state 1340 display_size_forced 341 airplane_mode_on 0342 wifi_on 1343 mode_ringer 1344 dock_sounds_enabled 1345 wifi_scan_always_enabled 1346 enable_quickboot 1347 assisted_gps_enabled 1348 package_verifier_enable 1349 backup_enabled 1350 touch_exploration_enabled 1351 accessibility_display_magnification_enabled 1352 lock_screen_owner_info_enabled 1353 power_menu_user_enabled 1354 sound_effects_enabled 1355 lockscreen_sounds_enabled 1356 haptic_feedback_enabled 1357 volume_adjust_sounds_enabled 1
3、global表settingsgetglobalnamespacekeysettingsputglobalnamespacekeynamespacekey清单如下----------------------------------------------------------------
4、securesettingsgetsecurenamespacekeysettingsputsecurenamespacekeynamespacekey清单如下----------------------------------------------------------------2 wifi_watchdog_watch_list GoogleGuest3 mock_location 04 backup_enabled 05 backup_transport com.google.android.backup/.BackupTransportService6 mount_play_not_snd 17 mount_ums_autostart 08 mount_ums_prompt 19 mount_ums_notify_enabled 110 accessibility_script_injection 011 accessibility_web_content_key_bindings 0x13=0x01000100;0x14=0x01010100;0x15=0x02000001;0x16=0x02010001;0x200000013=0x02000601;0x200000014=0x02010601;0x200000015=0x03020101;0x200000016=0x03010201;0x200000023=0x02000301;0x200000024=0x02010301;0x200000037=0x03070201;0x200000038=0x03000701:0x03010701:0x03020701;12 long_press_timeout 50013 touch_exploration_enabled 014 speak_password 015 accessibility_script_injection_url https://ssl.gstatic.com/accessibility/javascript/android/AndroidVox_v1.js16 lockscreen.disabled 017 screensaver_enabled 118 screensaver_activate_on_dock 119 screensaver_activate_on_sleep 020 screensaver_components com.android.deskclock/com.android.deskclock.Screensaver21 screensaver_default_component com.android.deskclock/com.android.deskclock.Screensaver22 accessibility_display_magnification_enabled 023 accessibility_display_magnification_scale 2.024 accessibility_display_magnification_auto_update 126 default_theme_package 27 default_theme_components 28 android_id 8c3f03f7581135df31 selected_input_method_subtype -132 selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService33 selected_spell_checker_subtype 035 lock_screen_owner_info_enabled 037 sms_default_application com.android.mms39 input_methods_subtype_history com.android.inputmethod.latin/.LatinIME;-92108810441 bluetooth_address 22:22:F5:8B:19:1242 bluetooth_addr_valid 143 user_setup_complete 145 lock_screen_fallback_appwidget_id 446 advanced_reboot 148 location_providers_allowed 50 enabled_input_methods com.android.inputmethod.latin/.LatinIME:com.iflytek.inputmethod/.FlyIME51 default_input_method com.iflytek.inputmethod/.FlyIME53 recents_long_press_activity 54 incall_power_button_behavior 255 ring_home_button_behavior 256 app_perf_profiles_enabled 161 enabled_notification_listeners org.cyanogenmod.theme.chooser/org.cyanogenmod.theme.chooser.NotificationHijackingService65 adb_port -166 bluetooth_name qing67 themeConfig {"default":{"mOverlayPkgName":"holo","mIconPkgName":"holo","mFontPkgName":"holo"}}