How does Android modify the default M for automatic data synchronization?

Source: Internet
Author: User

 

 

After the first boot, choose Settings> More> traffic usage> option> automatic data synchronization. How can I change the default status?

Find the SyncStorageEngine. java file (alpsrameworksasecorejavaandroidcontent)

In versions earlier than JB (excluding JB), automatic synchronization is performed by default. If this parameter is set to False, automatic synchronization is not performed.

MMasterSyncAutomatically = Ture-"False

In Versions later than JB (including JB), you need to make the following changes:

 

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 ());

 

// If the CMCC project is modified, the original value is false. Change it to true. Thank you!

Return auto = null? False: auto;

// Modification ended

 

} Else {

// If the project is not CMCC, It is selected by default. If it is not synchronized by default, it must be changed to false.

Return auto = null? True: auto;

}

// Return auto = null? Mdefamastermastersyncautomatically: auto;

}

}

2. private void readAccountInfoLocked (){
...
MMasterSyncAutomatically. put (0, listen = null | Boolean. parseBoolean (listen ));
To:
MMasterSyncAutomatically. put (0, Boolean. parseBoolean (listen ));

After modification, try again.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.