完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
Platform: Rockchip
OS: Android 6.0 Kernel: 3.10.92 系统默认使用的是12小时制时间格式. 当触摸设置的24小时格式时,会有如下调用: packages/apps/Settings/src/com/android/ettings/DateTimeSettings.java onPreferenceTreeClick -> mTime24Pref.isChecked //触摸选择后返回true set24Hour -> //设置24小时格式 Settings.System.putString(...,Settings.System.TIME_12_24,is24Hour? HOURS_24 : HOURS_12); Settings.System.TIME_12_24的值是"time_12_24"; 所以本质上就是设置database了, 6.0设置的是xml了. root@rk3288:/data/system/users/0 # busybox cat settings_system.xml | grep time_12_24 < 判断是否是12/24小时制其实也是从xml文件里获取: is24Hour -> DateFormat.is24HourFormat -> is24HourFormat -> DataFormat.java Settings.System.getStringForUser(...,Settings.System.TIME_12_24,...); 解决方法: [kris@:~/rk3288/frameworks/base/packages/SettingsProvider]$ g df diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index f8b85c3..dcb6e97 100755 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -220,4 +220,7 @@ com.sohu.inputmethod.sogou/.SogouIME + + 24 + diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 657af87..908520e 100755 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2395,6 +2395,10 @@ class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.System.POINTER_SPEED, R.integer.def_pointer_speed); //加在loadSystemSettings()中~ + /*Kris, 170418, Use 24-hour format by default.*/ + loadStringSetting(stmt, Settings.System.TIME_12_24, R.string.time_12_24); + /* * IMPORTANT: Do not add any more upgrade steps here as the global, * secure, and system settings are no longer stored in a database |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
569 浏览 0 评论
839 浏览 1 评论
737 浏览 1 评论
1957 浏览 1 评论
3204 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 07:09 , Processed in 0.530978 second(s), Total 71, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号