声明

  • 通常情况下,Android系统定制的一个重要环节是对系统性功能的裁剪、增加,最能体现系统功能的就是Setting应用中的设置项,系统功能的多少一般都会体现在Setting中。
  • 另外就是系统的属性

1 Settings应用的默认值

    在源码目录~/LineageOS/frameworks/base/packages/SettingsProvider/res/values/defaults.xml中:

<?xml version="1.0" encoding="utf-8"?>
<!--
/*** Copyright (c) 2009, The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
-->
<resources><bool name="def_dim_screen">true</bool><integer name="def_screen_off_timeout">60000</integer><integer name="def_sleep_timeout">-1</integer><bool name="def_airplane_mode_on">false</bool><bool name="def_theater_mode_on">false</bool><!-- Comma-separated list of bluetooth, wifi, and cell. --><string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc,wimax</string><string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string><string name="def_bluetooth_disabled_profiles" translatable="false">0</string><bool name="def_auto_time">true</bool><bool name="def_auto_time_zone">true</bool><bool name="def_accelerometer_rotation">true</bool><!-- Default screen brightness, from 0 to 255.  102 is 40%. --><integer name="def_screen_brightness">102</integer><bool name="def_screen_brightness_automatic_mode">false</bool><fraction name="def_window_animation_scale">100%</fraction><fraction name="def_window_transition_scale">100%</fraction><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_install_non_market_apps">false</bool><bool name="def_package_verifier_enable">true</bool><!-- Comma-separated list of location providers.Network location is off by default because it requiresuser opt-in via Setup Wizard or Settings.--><string name="def_location_providers_allowed" translatable="false">gps</string><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_show_password_on">true</bool><bool name="config_show_password_on">false</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><bool name="def_backup_enabled">false</bool><string name="def_backup_transport" translatable="false">android/com.android.internal.backup.LocalTransport</string><!-- Default value for whether or not to pulse the notification LED when there is apending notification --><bool name="def_notification_pulse">true</bool><bool name="def_mount_play_notification_snd">true</bool><bool name="def_mount_ums_autostart">false</bool><bool name="def_mount_ums_prompt">true</bool><bool name="def_mount_ums_notify_enabled">true</bool><!-- user interface sound effects --><integer name="def_power_sounds_enabled">1</integer><string name="def_low_battery_sound" translatable="false">/system/media/audio/ui/LowBattery.ogg</string><integer name="def_dock_sounds_enabled">0</integer><integer name="def_dock_sounds_enabled_when_accessibility">0</integer><string name="def_desk_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string><string name="def_desk_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string><string name="def_car_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string><string name="def_car_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string><integer name="def_lockscreen_sounds_enabled">1</integer><string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string><string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string><string name="def_trusted_sound" translatable="false">/system/media/audio/ui/Trusted.ogg</string><string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string><bool name="def_lockscreen_disabled">false</bool><bool name="def_device_provisioned">false</bool><integer name="def_dock_audio_media_enabled">1</integer><!-- Notifications use ringer volume --><bool name="def_notifications_use_ring_volume">true</bool><!-- Default for Settings.System.VIBRATE_IN_SILENT --><bool name="def_vibrate_in_silent">true</bool><!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION --><bool name="def_accessibility_script_injection">false</bool><!-- Default for Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD --><bool name="def_accessibility_speak_password">false</bool><!-- Default for Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS --><string name="def_accessibility_web_content_key_bindings" translatable="false"><!-- DPAD/Trackball UP - traverse previous on current axis and send an event. -->0x13=0x01000100;<!-- DPAD/Trackball DOWN - traverse next on current axis and send an event. -->0x14=0x01010100;<!-- DPAD/Trackball LEFT - traverse previous on the character navigation axis and send event. -->0x15=0x02000001;<!-- DPAD/Trackball RIGHT - traverse next on the character navigation axis end send event. -->0x16=0x02010001;<!-- Alt+DPAD/Trackball UP - go to the top of the document. -->0x200000013=0x02000601;<!-- Alt+DPAD/Trackball DOWN - go to the bottom of the document. -->0x200000014=0x02010601;<!-- Alt+DPAD/Trackball LEFT - transition from an axis to another and sends an event.--><!-- Axis transitions: 2 -> 1; -->0x200000015=0x03020101;<!-- Alt+DPAD/Trackball RIGHT - transition from an axis to another and sends an event. --><!-- Axis transitions:  1 -> 2; -->0x200000016=0x03010201;<!-- Alt+g - go to the previous heading and send an event. -->0x200000023=0x02000301;<!-- Alt+h - go to the next heading and send an event. -->0x200000024=0x02010301;<!-- Alt+COMMA - transition to sentence navigation axis and send an event. --><!-- Axis transitions:  7 -> 2; -->0x200000037=0x03070201;<!-- Alt+PERIOD - transition to default web view behavior axis and send an event. --><!-- Axis transitions:  0 -> 7; 1 - > 7; 2 -> 7; -->0x200000038=0x03000701:0x03010701:0x03020701;</string><!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION_URL --><string name="def_accessibility_screen_reader_url" translatable="false">https://ssl.gstatic.com/accessibility/javascript/android/AndroidVox_v1.js</string><!-- Default for Settings.Secure.TOUCH_EXPLORATION_ENABLED --><bool name="def_touch_exploration_enabled">false</bool><!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE --><fraction name="def_accessibility_display_magnification_scale">200%</fraction><!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED --><bool name="def_accessibility_display_magnification_enabled">false</bool><!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE --><bool name="def_accessibility_display_magnification_auto_update">true</bool><!-- Default for Settings.System.USER_ROTATION --><integer name="def_user_rotation">0</integer><!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit --><integer name="def_download_manager_max_bytes_over_mobile">-1</integer><!-- Default for Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE. <=0 if no limit --><integer name="def_download_manager_recommended_max_bytes_over_mobile">-1</integer><!-- Default for Settings.Secure.LONG_PRESS_TIMEOUT_MILLIS --><integer name="def_long_press_timeout_millis">400</integer><!-- Default for Settings.Secure.MULTI_PRESS_TIMEOUT --><integer name="def_multi_press_timeout_millis">300</integer><!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD --><bool name="def_show_ime_with_hard_keyboard">false</bool><!-- Default for Settings.System.POINTER_SPEED --><integer name="def_pointer_speed">0</integer><!-- Default for DTMF tones enabled --><bool name="def_dtmf_tones_enabled">true</bool><!-- Default for UI touch sounds enabled --><bool name="def_sound_effects_enabled">true</bool><!-- Development settings --><bool name="def_stay_on_while_plugged_in">false</bool><!-- Number of retries for connecting to DHCP.Value here is the same as WifiStateMachine.DEFAULT_MAX_DHCP_RETRIES --><integer name="def_max_dhcp_retries">9</integer><!-- Default for Settings.Secure.USER_SETUP_COMPLETE --><bool name="def_user_setup_complete">false</bool><!-- Default for Settings.Global.LOW_BATTERY_SOUND_TIMEOUT.0 means no timeout; battery sounds will always play>0 is milliseconds of screen-off time after which battery sounds will not play --><integer name="def_low_battery_sound_timeout">0</integer><!-- Initial value for the Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS setting,which is a comma separated list of packages that no longer need confirmationfor immersive mode.Override to disable immersive mode confirmation for certain packages. --><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><!-- Default for Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1==on --><integer name="def_lock_screen_show_notifications">1</integer><!-- Default for Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS --><bool name="def_lock_screen_allow_private_notifications">true</bool><!-- Default for Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, 1==on --><integer name="def_heads_up_enabled">1</integer><!-- Default for Settings.Global.DEVICE_NAME $1=MANUFACTURER $2=MODEL--><string name="def_device_name">%1$s %2$s</string><!-- Default for Settings.Global.DEVICE_NAME $1=MODEL--><string name="def_device_name_simple">%1$s</string><!-- Default for Settings.Secure.WAKE_GESTURE_ENABLED --><bool name="def_wake_gesture_enabled">true</bool><!-- Default state of tap to wake --><bool name="def_double_tap_to_wake">true</bool><!-- Default for Settings.Secure.NFC_PAYMENT_COMPONENT --><string name="def_nfc_payment_component"></string><!-- Default setting for ability to add users from the lock screen --><bool name="def_add_users_from_lockscreen">false</bool><!-- custom system sound or not --><bool name="def_custom_sys_volume">false</bool><!-- Ringtone Volume,its value is from 0 to 7,default value is 5 --><integer name="def_ringtone_volume" translatable="false">5</integer><!-- Music Volume,its value is from 0 to 15,default value is 11 --><integer name="def_music_volume" translatable="false">11</integer><!-- Voice Call Volume,its value is from 0 to 5,default value is 4 --><integer name="def_voice_call_volume" translatable="false">4</integer><!-- Alarm Volume,its value is from 0 to 7,default value is 6 --><integer name="def_alarm_volume" translatable="false">6</integer><!-- Notification Volume,its value is from 0 to 7,default value is 5 --><integer name="def_notification_volume" translatable="false">5</integer><!-- Ringtone headset Volume,its value is from 0 to 7,default value is 5 --><integer name="def_ringtone_headset_volume" translatable="false">5</integer><!-- Music headset Volume,its value is from 0 to 15,default value is 11 --><integer name="def_music_headset_volume" translatable="false">11</integer><!-- Voice Call headset Volume,its value is from 0 to 5,default value is 4 --><integer name="def_voice_call_headset_volume" translatable="false">4</integer><!-- Alarm headset Volume,its value is from 0 to 7,default value is 6 --><integer name="def_alarm_headset_volume" translatable="false">6</integer><!-- Notification headset Volume,its value is from 0 to 7,default value is 5 --><integer name="def_notification_headset_volume" translatable="false">5</integer><!-- Ringtone speaker Volume,its value is from 0 to 7,default value is 5 --><integer name="def_ringtone_speaker_volume" translatable="false">5</integer><!-- Music speaker Volume,its value is from 0 to 15,default value is 11 --><integer name="def_music_speaker_volume" translatable="false">11</integer><!-- Voice Call speaker Volume,its value is from 0 to 5,default value is 4 --><integer name="def_voice_call_speaker_volume" translatable="false">4</integer><!-- Alarm speaker Volume,its value is from 0 to 7,default value is 6 --><integer name="def_alarm_speaker_volume" translatable="false">6</integer><!-- Notification speaker Volume,its value is from 0 to 7,default value is 5 --><integer name="def_notification_speaker_volume" translatable="false">5</integer><!-- Voice Call earpiece Volume,its value is from 0 to 5,default value is 4 --><integer name="def_voice_call_earpiece_volume" translatable="false">4</integer><!-- Date format,yyyy-MM-dd: 2013/07/30; MM-dd-yyyy:07/30/2013; dd-MM-yyyy:30/07/2013 --><string name="def_date_format" translatable="false"></string><!-- Time format,default value is 24 : 24 format,other value is 12 format --><string name="def_time_format" translatable="false"></string><!-- enable accessibility or not,1:enable;0:disable --><integer name="def_enable_accessibility">0</integer><!-- for enable accessibility services,split by ":" ,example "com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService" --><string name="def_enable_accessibility_services" translatable="false"></string><!-- Default Input Method, its value is from inputmethod's package name and main class namesuch as "com.android.inputmethod.pinyin/.PinyinIME"--><string name="def_input_method" translatable="false"></string><!--Default Enable InputMethods, its value is from inputmethod's package name and main classname such as "com.android.inputmethod.pinyin/.PinyinIME" ;This is a stringcontaining the IDs of all enabled input methods, each ID separated by ':'.--><string name="def_enable_input_methods" translatable="false"></string><!-- Default for Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED --><integer name="def_captive_portal_detection_enabled" translatable="false">1</integer><!-- Default for Settings.Global.ETHERNET_ON {ETHERNET_STATE_UNKNOWN,ETHERNET_STATE_DISABLED,ETHERNET_STATE_ENABLED}--><integer name="def_ethernet_on">2</integer><!-- Default for Settings.Global.ETHERNET_STATIC_IP--><string name="def_ethernet_static_ip"></string><!-- Default for Settings.Global.ETHERNET_STATIC_MASK--><string name="def_ethernet_static_mask">255.255.255.0</string><!-- Default for Settings.Global.ETHERNET_STATIC_GATEWAY--><string name="def_ethernet_static_gateway"></string><!-- Default for Settings.Global.ETHERNET_STATIC_DNS1--><string name="def_ethernet_static_dns1"></string><!-- Default for Settings.Global.ETHERNET_STATIC_DNS2--><string name="def_ethernet_static_dns2"></string>
</resources>

2 系统属性值

    系统属性值一般存储在下面文件中:
在源码文件~/LineageOS/bionic/libc/include/sys/_system_properties.hz中定义了几个宏:

#define PROP_PATH_RAMDISK_DEFAULT  "/default.prop"
#define PROP_PATH_SYSTEM_BUILD     "/system/build.prop"
#define PROP_PATH_VENDOR_BUILD     "/vendor/build.prop"
#define PROP_PATH_LOCAL_OVERRIDE   "/data/local.prop"
#define PROP_PATH_FACTORY          "/factory/factory.prop"

    在运行中,init进程会启动属性服务,属性服务初始化时会去这几个文件中加载属性值。

    可以在源码位置~/LineageOS/device/lge/hammerheadcaf/system.prop中查看配置好的属性值:

# API
ro.product.first_api_level=19# Audio
media.aac_51_output_enabled=true
ro.qc.sdk.audio.fluencetype=fluence
persist.audio.fluence.voicecall=true
persist.audio.fluence.audiorec=true
audio.offload.buffer.size.kb=32
audio.offload.gapless.enabled=true
audio.offload.video=true
audio.offload.pcm.16bit.enable=true
audio.offload.pcm.24bit.enable=true
qcom.hw.aac.encoder=true
af.fast_track_multiplier=1
audio_hal.period_size=192# Camera
camera.disable_zsl_mode=1
media.stagefright.legacyencoder=true
media.stagefright.less-secure=true# Dalvik/VM
dalvik.vm.dex2oat-swap=false
dalvik.vm.heapminfree=2m# Display
persist.hwc.mdpcomp.enable=true
persist.mdpcomp_perfhint=50# Graphics
ro.opengles.version=196608
ro.sf.lcd_density=480# Input
ro.input.noresample=1# Net
net.tethering.noprovisioning=true# Perf
ro.vendor.extension_library=libqti-perfd-client.so# QCOM
drm.service.enabled=true# Radio/RIL/Telephony
persist.radio.apm_sim_not_pwdn=1
persist.radio.mode_pref_nv10=1
persist.radio.snapshot_enabled=1
persist.radio.snapshot_timer=2
persist.radio.use_cc_names=true
persist.radio.data_no_toggle=1
persist.radio.custom_ecc=1
persist.radio.always_send_plmn=true
rild.libpath=/system/lib/libril-qc-qmi-1.so
ro.telephony.call_ring.multiple=0
ro.telephony.default_network=10
telephony.lteOnCdmaDevice=1# Sensors
ro.qti.sensors.max_geomag_rotv=60
ro.qti.sensors.max_gyro_rate=200
ro.qti.sensors.max_accel_rate=200
ro.qti.sensors.max_grav=200
ro.qti.sensors.max_rotvec=200
ro.qti.sensors.max_orient=200
ro.qti.sensors.max_linacc=200
ro.qti.sensors.max_gamerv_rate=200
ro.qti.sensors.smd=true
ro.qti.sensors.game_rv=true
ro.qti.sensors.georv=true
ro.qti.sensors.smgr_mag_cal_en=true
ro.qti.sensors.step_detector=true
ro.qti.sensors.step_counter=true
ro.qti.sensors.pick_up=false
ro.qti.sensors.tap=false
ro.qti.sensors.facing=false
ro.qti.sensors.tilt=false
ro.qti.sensors.tilt_detector=true
ro.qti.sensors.amd=false
ro.qti.sensors.rmd=false
ro.qti.sensors.vmd=false
ro.qti.sensors.pedometer=false
ro.qti.sensors.pam=false
ro.qti.sdk.sensors.gestures=false
persist.debug.sensors.hal=w
debug.qualcomm.sns.daemon=w
debug.qualcomm.sns.libsensor1=w# Storage
ro.sys.sdcardfs=true# Wifi
wifi.interface=wlan0

3 Enjoy

    通过修改这个属性值和defaults.xml中的值,载编译系统代码,刷机后就可以实现某些开机设定的配置了。

cm-14.1 Android系统定制(三):Setting相关的默认值、系统属性相关推荐

  1. cm-14.1 Android系统定制(二):内置系统应用

    声明 Android系统定制时免不了预置一些APP进系统中: 预置的结果一般有三种:       1.预置的APK用户可以卸载,恢复出厂设置后APK不恢复:       2.预置的APP用户可以卸载, ...

  2. 苹果电脑带有双系统Mac/Win,如何更改默认启动系统?

    苹果电脑安装了Mac+Windows10双系统后,每次启动将默认为Windows,那么我们如何更改默认启动系统? 除了每次开机即按住"option"键,可以手动选择Mac系统或wi ...

  3. 导览系统定制开发_联联周边游系统源码定制开发平台方案

    点击上方关注我们! 联联周边游系统开发,找[金生157威6875店2419同号]联联周边游软件开发,联联周边游系统APP开发,联联周边游系统小程序开发,联联周边游系统开发模式,联联周边游系统平台开发, ...

  4. 不同品牌android手机ui,三种不同界面的安卓系统_华为手机_手机Android频道-中关村在线...

    虽然三款产品均搭载的是谷歌Android智能系统,但同时也都植入了各家自己研发的操作界面,红米Note是MIUI V5,酷派大神F1是CoolLife UI,华为荣耀畅玩版是Emotion UI,这三 ...

  5. android远程控制(三)----通过后台服务实现系统点击事件模拟

    整合后台服务和驱动代码注入 Home键的驱动代码: /dev/input/event1: 0001 0066 00000001 /dev/input/event1: 0000 0000 0000000 ...

  6. 信用卡分销系统源码、分销系统定制贴牌、信用卡三级分销系统源码、信用卡返佣系统OEM...

    信用卡返佣分销系统贴牌,全套源码,可定制UI界面 这一整套绝对是市场上最完善最好的一套系统:里面的特色功能: 1.合伙人功能,解决你前期的资金以及资源问题 2.推广素材库,全方位增加推广效率 3.红包 ...

  7. 在家无聊就重装个系统吧 三分钟教你重装安装系统

    周末宅在家,又不喜欢出去玩的朋友,一定是无聊至极吧,那么何妨不利用这个时间,一起来学习一下这个非常具有帮助属性的电脑重装系统呢.我们都知道,原先我们重装系统最原始的前十几年.二十年,我们一般通过光盘装 ...

  8. 重启linux系统的三种方法,强制重启Linux系统的几种方法

    实际生产环境中某些情况下 Linux 服务器系统在出现致命错误需要远程进行重启,通过常规的 reboot.init 6 等方法无法正常重启(例如重启时卡在驱动程序里等情况),这时就需要通过下面介绍的几 ...

  9. win8如何在已安装多系统的情况下,更改默认开机系统

    以win8,为例.右键计算机,打开属性打开高级系统设置.,在启动和故障恢复的设置中进行更改,

最新文章

  1. 黑客渗透入门教程 第一课:粗暴的端口扫描
  2. Python 字符串前面加u,r,b的含义
  3. 轻量级高精度人脸检测推荐
  4. iOS多设备分辨率适配
  5. VC实现基于Office 2007 MODI 12.0实现图形文字识别(OCR)的程序
  6. Minetorch教程
  7. 奥迪坚SVRM(Screen-Voice Recording Manager)录屏软件正式发布
  8. MySQL主从数据库配置
  9. golang mysql 插入_Mysql学习(一)添加一个新的用户并用golang操作Mysql
  10. android同步aar到jcenter,android上传aar到jcenter
  11. 在 Mac 上的登录窗口中如何打开辅助功能选项?
  12. 搭建ftp_Windows 10搭建FTP服务器!
  13. idea添加scala环境_Scala篇:Scala环境及IDEA配置
  14. 安卓 手机硬改 工具下载 一键新机 改串 抹机 root隐藏 改串号MEID imei SN信息 工具教程分享
  15. Gamit 数据处理,相关的文件配置
  16. 转专业申请麦吉尔大学计算机,我在麦吉尔大学学习数学专业……
  17. 微信小程序:语音变声器支持多种音效与流量主
  18. SAP中物料采购PO和SA共存情况下的标准价格确定
  19. AR涂涂乐项目之识别图制作制作地球仪线框二
  20. 分享几个关于geoJson的网站(乡镇级地图绘制)

热门文章

  1. 《JAVA编程思想》学习笔记:第21章(并发)
  2. 三百个好用又免费的软件名单
  3. Windows系统丢失 .dll 文件的解决方案
  4. c++双人战争小游戏
  5. css层叠样式表基础学习笔记--第五章 文本属性
  6. 招商基金招聘运维开发岗(地点:深圳)
  7. BTree,B-Tree,B+Tree,B*Tree都是什么
  8. 2021原创计算机考研全程班辅导
  9. mybatis plus报错:Invalid bound statement (not found)
  10. android studio绘制统计图,基于Android Studio的饼图账单的设计与开发_毕业论文.doc