代码路径:
frameworks/base/packages/SettingsProvider/res/values/defaults.xml
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
设置默认GPS校时
<bool name="def_auto_time_gps">true</bool>
设置默认打开GPS,这里有网络和GPS两种方式,如果只需要GPS就把network去掉
<string name="def_location_providers_allowed" translatable="false">network,gps</string>
<bool name="assisted_gps_enabled">true</bool>
设置24小时制
在defaults.xml文件中将time_12_24变量设置为24
<string name="time_12_24">24</string>
在DatabaseHelper.java文件中loadSystemSettings()方法中加载到数据库中
private void loadSystemSettings(SQLiteDatabase db) {
SQLiteStatement stmt = null;
try {
stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"
+ " VALUES(?,?);");
loadStringSetting(stmt, Settings.System.TIME_12_24, R.string.time_12_24);
}