2525
2626import android .accounts .Account ;
2727import android .accounts .AccountAndUser ;
28+ import android .content .res .Resources ;
2829import android .database .Cursor ;
2930import android .database .sqlite .SQLiteDatabase ;
3031import android .database .sqlite .SQLiteException ;
@@ -336,6 +337,7 @@ interface OnSyncRequestListener {
336337
337338 private int mNextHistoryId = 0 ;
338339 private SparseArray <Boolean > mMasterSyncAutomatically = new SparseArray <Boolean >();
340+ private boolean mDefaultMasterSyncAutomatically ;
339341
340342 private OnSyncRequestListener mSyncRequestListener ;
341343
@@ -345,6 +347,9 @@ private SyncStorageEngine(Context context, File dataDir) {
345347
346348 mCal = Calendar .getInstance (TimeZone .getTimeZone ("GMT+0" ));
347349
350+ mDefaultMasterSyncAutomatically = mContext .getResources ().getBoolean (
351+ com .android .internal .R .bool .config_syncstorageengine_masterSyncAutomatically );
352+
348353 File systemDir = new File (dataDir , "system" );
349354 File syncDir = new File (systemDir , "sync" );
350355 syncDir .mkdirs ();
@@ -780,7 +785,7 @@ public void setMasterSyncAutomatically(boolean flag, int userId) {
780785 public boolean getMasterSyncAutomatically (int userId ) {
781786 synchronized (mAuthorities ) {
782787 Boolean auto = mMasterSyncAutomatically .get (userId );
783- return auto == null ? true : auto ;
788+ return auto == null ? mDefaultMasterSyncAutomatically : auto ;
784789 }
785790 }
786791
0 commit comments