赞
踩
不同的产品开发有不同的需求对于默认的时间
build/make/tools/buildinfo_common.sh
framework/base/packages/apps/SettingsProvider/res/values/defaults.xml
framework/base/packages/apps/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
在buildinfo_common.sh 中添加时区属性persist.sys.timezone
android 默认时区 为GMT 0时区,默认设置为北京或者上海
#!/bin/bash partition="$1" if [ "$#" -ne 1 ]; then echo "Usage: $0 <partition>" 1>&2 exit 1 fi echo "# begin common build properties" echo "# autogenerated by $0" echo "ro.${partition}.build.date=`$DATE`" echo "ro.${partition}.build.date.utc=`$DATE +%s`" echo "ro.${partition}.build.fingerprint=$BUILD_FINGERPRINT" echo "ro.${partition}.build.id=$BUILD_ID" echo "ro.${partition}.build.tags=$BUILD_VERSION_TAGS" echo "ro.${partition}.build.type=$TARGET_BUILD_TYPE" echo "ro.${partition}.build.version.incremental=$BUILD_NUMBER" echo "ro.${partition}.build.version.release=$PLATFORM_VERSION_LAST_STABLE" echo "ro.${partition}.build.version.release_or_codename=$PLATFORM_VERSION" echo "ro.${partition}.build.version.sdk=$PLATFORM_SDK_VERSION" echo "ro.product.${partition}.brand=$PRODUCT_BRAND" echo "ro.product.${partition}.device=$PRODUCT_DEVICE" echo "ro.product.${partition}.manufacturer=$PRODUCT_MANUFACTURER" echo "ro.product.${partition}.model=$PRODUCT_MODEL" echo "ro.product.${partition}.name=$PRODUCT_NAME" + echo "persist.sys.timezone=Asia/Shanghai" echo "# end common build properties"
<resources> <bool name="def_dim_screen">true</bool> <integer name="def_screen_off_timeout">300000</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> + <string name="def_time_12_24">24</string> <bool name="def_accelerometer_rotation">false</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> <integer name="def_show_battery_percent">1</integer> <bool name="def_bluetooth_on">false</bool> <bool name="def_wifi_display_on">false</bool> <bool name="def_install_non_market_apps">false</bool> <!-- 0 == off, 3 == on --> <integer name="def_location_mode">3</integer> <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> <!-- 0 == never, 1 == only when plugged in, 2 == always --> <integer name="def_wifi_sleep_policy">2</integer> <bool name="def_wifi_wakeup_enabled">true</bool> <bool name="def_networks_available_notification_on">true</bool> ... </resources>
private void loadSystemSettings(SQLiteDatabase db) { SQLiteStatement stmt = null; try { stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)" + " VALUES(?,?);"); loadBooleanSetting(stmt, Settings.System.DIM_SCREEN, R.bool.def_dim_screen); loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT, R.integer.def_screen_off_timeout); // Set default cdma DTMF type loadSetting(stmt, Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, 0); + loadStringSetting(stmt, Settings.System.TIME_12_24, R.string.def_time_12_24); // Set default hearing aid loadSetting(stmt, Settings.System.HEARING_AID, 0); // Set default tty mode loadSetting(stmt, Settings.System.TTY_MODE, 0); loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS, R.integer.def_screen_brightness); loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_FOR_VR, com.android.internal.R.integer.config_screenBrightnessForVrSettingDefault); loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE, R.bool.def_screen_brightness_automatic_mode); loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, R.bool.def_accelerometer_rotation); loadDefaultHapticSettings(stmt); loadBooleanSetting(stmt, Settings.System.NOTIFICATION_LIGHT_PULSE, R.bool.def_notification_pulse); loadUISoundEffectsSettings(stmt); loadIntegerSetting(stmt, Settings.System.POINTER_SPEED, R.integer.def_pointer_speed); loadIntegerSetting(stmt, Settings.System.SHOW_BATTERY_PERCENT, R.integer.def_show_battery_percent); /// M: Load MTK added System providers before Android M. mUtils.loadCustomSystemSettings(stmt); /* * IMPORTANT: Do not add any more upgrade steps here as the global, * secure, and system settings are no longer stored in a database * but are kept in memory and persisted to XML. * * See: SettingsProvider.UpgradeController#onUpgradeLocked */ } finally { if (stmt != null) stmt.close(); }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。