2025-03-24

 

 

首次開機後,進入設置->更多->流量使用情況->option菜單 –>自動同步數據,如何更改默認狀態?

請找到文件 SyncStorageEngine.java (alpsrameworksasecorejavaandroidcontent)

JB之前的版本上(不含JB)默認為自動同步,修改為False,則不會自動同步。

mMasterSyncAutomatically=Ture –》 False

JB之後的版本上(包含JB) 需做以下修改:

 

1. public boolean getMasterSyncAutomatically(int userId) {

synchronized (mAuthorities) {

Boolean auto = .get(userId);

Log.d(TAG,userId=+userId+ auto=+auto+ mExt=+mExt);

if(mExt != null && mExt.getCurrentOPIndex() == 1){

///M: add for cmccc when there is no account default auto sync is off

Log.d(TAG,mExt.getCurrentOPIndex()=+mExt.getCurrentOPIndex());

 

// 若是CMCC的project修改這裡 將原來 false ,改為ture 謝謝!

return auto == null ? false : auto;

//修改結束

 

} else {

// 若是非CMCC的project修改這裡的 ,當前默認選中,若需默認不同步需更改為false

return auto == null ? true : auto;

}

//return auto == null ? mDefaultMasterSyncAutomatically : auto;

}

}

2. private void readAccountInfoLocked() {

mMasterSyncAutomatically.put(0, listen == null || Boolean.parseBoolean(listen));
修改為:
mMasterSyncAutomatically.put(0, Boolean.parseBoolean(listen));

請修改完之後再測試。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *