完善资料让更多小伙伴认识你,还能领取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 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1924 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2406 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5193 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 18:57 , Processed in 0.568593 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号