Android 修改出厂默认日期和默认时区 MTK
11886 点击·0 回帖
![]() | ![]() | |
![]() | 正文
[DESCRIPTION] 如何修改为出厂时区为指定的时区和默认的日期? [Solution] 时间信息预设信息都是0, 在rtc 初试化时候设置的. 由于RTC 基本上不会断电,所以它的初试化只做一次,即使重新download bin 档. 用FlashTool 执行Format, 再执行download (不要用format -->download button), 或者RTC断电一段时间,就可以观察到日期恢复到出厂值。 修改默认日期: 修改文件 \alps\mediatek\custom\[project]\preloader\ inc\cust_rtc.h \alps\mediatek\custom\[project]\kernel\rtc\rtc\rtc-mt65XX.h #define RTC_DEFAULT_YEA 2012 #define RTC_DEFAULT_MTH 2 #define RTC_DEFAULT_DOM 1 在JB之前,进行以上修改即可,如果是JB,还需要进行以下修改: [File] framework\services\java\com\android\server\NetworkTimeUpdateService.java [Function] systemReady() [Code] if(isFirstBoot){ Time today = new Time(Time.getCurrentTimezone()); today.setToNow(); // 請添加此行 如果要設置出廠默認年份需要修改 1) JB.SP/JB2.MP alps\mediatek\frameworks\base\res\res\values\config.xml 將 default_restore_year 修改成 2013 <!-- default year for first power on--> <integer name="default_restore_year">2013</integer> 2) JB.MP alps\frameworks\base\services\java\com\android\server\NetworkTimeUpdateService.java if(today.year <= 2010){ today.set(today.monthDay, today.month, 2013); Log.d(TAG, "Set the year to 2013"); SystemProperties.set(BOOT_SYS_PROPERTY, "false"); SystemClock.setCurrentTimeMillis(today.toMillis(false)); } 修改后的表现可通过Setting菜单->时间日期设置): 修改默认时区: 在系统属性中增加下面字段(假设改为Moscow) 路径:\alps\mediatek\config\[project]\system.prop persist.sys.timezone = Europe/Moscow 注意:默认时区的修改会影响默认时间的值,会根据与格林尼治标准时间差来更新时间,这是正常现象。如当前设置为中国标准时间GMT+8:00,则手机的出厂时间会变为8:00。 | |
![]() | ![]() |