微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 不勾选从网络自动更新时间,时间仍然会从网络获取时间更新

不勾选从网络自动更新时间,时间仍然会从网络获取时间更新

时间:10-02 整理:3721RD 点击:
不勾选:从网络自动更新时间,时间仍然会从网络获取时间更新?
[DESCRIPTION]
在设置中的Data&Time里面的:自动确定日期和时间,不勾选:使用网络提供时间,但时间仍然会从网络获取并更新
,下面方法可以解决此问题。
[SOLUTION]
在界面中测试发现一个规律:
取消“auto time”,然后“select time zone”,“set time”, “Use 24-hour
format”, “Select date format”等选项的改变都不会去更新时间,唯独“set
date”这项,在改变year的时候会有去网络更新时间的动作,而且是在改变后的year
比当前year要大时才动作,如果小则还是不会触发。 例如2012年改为2013年点确定
然后就会自动更新,而2012年改为2010年等小些的年份则不会自动更新。
log如下:
# D/SystemClock( 362): Setting time of day to sec=1363240369
smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
I/EventLogService( 330): Aggregate fROM 1331704345962 (log), 1331962934668
(data)
I/CheckinService( 330): Preparing to send checkin request
I/EventLogService( 330): Accumulating logs since 1363240369496
D/ResourceType( 330): calling getConfigurations
D/ResourceType( 330): called getConfigurations size=243
I/CheckinTask( 330): Sending checkin request (952 bytes)
E/CheckinTask( 330): SSL error, attempting time correction:
javax.net.ssl.SSLHandshakeException:
org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not
validate certificate: current time: Thu Mar 14 13:52:50 GMT+08:00 2013,
expiration time: Fri Mar 08 16:53:51 GMT+08:00 2013
smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
W/CheckinTask( 330): Setting time from 1363240370708 to 1331963570459
D/SystemClock( 83): Setting time of day to sec=1331963570
D/ResourceType( 330): calling getConfigurations
D/ResourceType( 330): called getConfigurations size=243
I/CheckinTask( 330): Checkin success:
https://android.clients.google.com/checkin (1 requests sent)
在设备中查询可得到 CheckinService其实是在GoogleServicephp?mod=tag&id=6090" target="_blank" class="relatedlink">Framework.apk中的
,没有源代码无法修改。
反编译GoogleServiceFramework.apk能得到一些有用的信息,反编译后查询到
I/CheckinService( 330): Preparing to send checkin request
存在于com.google.android.gsf/checkin/CheckinService$1
class CheckinService$1 extends CheckinTask
{
public ProtoBuf doInBackground(CheckinTask.Params[] paramArrayOfParams)
{
int i = 0;
ProtoBuf localProtoBuf;
while (CheckinService.access$100(this.this$0))
{
Log.i("CheckinService", "Preparing to send checkin request");
EventLogService.captureLogs(this.this$0);
localProtoBuf = super.doInBackground(paramArrayOfParams);
CheckinService.access$200(this.this$0, localProtoBuf);
}
return localProtoBuf;
}
看到doInBackground就怀疑是不是后台传输的问题,于是到“Accounts & sync
settings”中,关掉“Background data”,然后再在时间中设置,果然不会再变化!
所以修改系统让后台数据功能默认关闭。
frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<bool name="def_install_non_market_apps">true</bool>
<!-- jeff add default background data on/off. -->
<bool name="def_background_data">false</bool>
frameworks/base/packages/SettingsProvider/src/com/android/providers/settin
gs/DatabaseHelper.java
private void loADSecureSettings(SQLiteDatabase db) {
//jeff. def background data.
loadBooleanSetting(stmt, Settings.Secure.BACKGROUND_DATA,
R.bool.def_background_data);
默认不开启后台数据,可以是解决这个问题的一个方法。

这个可以有的,先学习

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top