赞
踩
只读默认语言
[ro.product.locale.language]:[en]
[ro.product.locale.region]: [US]
用户改变语言设置后修改的值
[persist.sys.language]: [zh]
[persist.sys.country]: [CN]
这两个会以文件的形式存在于文件系统的/data/property目录下(其实每个新设置的属性都会以属性名为文件名,以属性值为内容存在这个目录下),如果同名的属性即存在于/system/build.prop中,又存在于/data/property下,那末根据属性的读取顺序
同名覆盖的原则,最终的value是在/data/property中的。
可以在手机上改变语言设置后,用adb shell getprop命令查看系统属性,每次改变语言设置
persist.sys.language和 persist.sys.country都会相应改为所设置的语言,而
ro.product.locale.language和ro.product.locale.region是无法改变的。
我设置成功是在device/qcom/msm7627_qrd/system.prop
中加入:
persist.sys.timezone=Asia/Shanghai
persist.sys.language=zh
persist.sys.country=CN
重新开关机,恢复出厂设置均是正确的。
system.prop的内容在编译过程中会拷贝到system.img 的/system/build.prop中(至于system.prop是如何拷贝进去的,就不清楚了,只看到google建议
vendor在product下用这个文件来设置自己需要的system property),同时会写入到out/target/product/msm7627_qrd/recovery/root/default.prop中,所以恢复出厂设置才成功。
ps:产品下各个mk文件作用可以参考 http://www.kandroid.org/android_pdk/build_new_device.html
关于语言的配置有很多方法,如http://stackoverflow.com/questions/5814754/how-to-set-default-ime-in-porting-android ,不过这也许是错误的^_^
时区在Android中是通过Bionic C Library来管理的,具体可见
Timezone management:
The name of the current timezone is taken from the TZ environment variable, if defined. Otherwise, the system property named 'persist.sys.timezone' is checked instead. The zoneinfo timezone database and index files are located under directory /system/usr/share/zoneinfo, instead of the more Posix-compliant path of /usr/share/zoneinfo.
Timezone的WIKI:http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones.
BTW:我的错误修改方法
1.在system/core/rootdir/etc/init.qcom.rc中加入
setprop persist.sys.timezone Asia/Shanghai
结果:虽然开机可以在/data/property下生成了persist.sys.timezone文件,但是每次开机都会重写该文件,使timezone恢复回去。
2.在device/qcom/msm7627_qrd/msm7627_qrd.mk中加入
ADDITIONAL_BUILD_PROPERTIES += persist.sys.timezone=Asia/Shanghai
结果:也可以在/data/property下生成persist.sys.timezone文件,设置改变后,重新开机也不会被覆盖掉,但是一旦恢复出厂设置,timezone就成了默认的格林尼治时区>_<!~!
ADDITIONAL_BUILD_PROPERTIES:指定(增加)额外的属性文件;
1.关于语言的修改很详细了 http://blog.csdn.net/dahailantian1/archive/2011/01/16/6144676.aspx
不过此文中将属性加入到这个变量中PRODUCT_PROPERTY_OVERRIDES := /
persist.sys.language=zh /
persist.sys.country=CN ,没有试过是否OK!
2.深入理解Android的System property:http://blog.csdn.net/tekkamanitachi/archive/2009/06/18/4280982.aspx
中类似的修改还有#added :set default ring
ro.config.ringtone=Noises1.ogg
ro.config.notification_sound=Tinkerbell.ogg
#added by yue :LCD is 480x800 ,这样设置后图标才会正常显示否则会非常小
ro.sf.lcd_density=240
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。