2626
2727import android .accounts .Account ;
2828import android .accounts .AccountAndUser ;
29+ import android .content .res .Resources ;
2930import android .database .Cursor ;
3031import android .database .sqlite .SQLiteDatabase ;
3132import android .database .sqlite .SQLiteException ;
@@ -337,6 +338,7 @@ interface OnSyncRequestListener {
337338
338339 private int mNextHistoryId = 0 ;
339340 private SparseArray <Boolean > mMasterSyncAutomatically = new SparseArray <Boolean >();
341+ private boolean mDefaultMasterSyncAutomatically ;
340342
341343 private OnSyncRequestListener mSyncRequestListener ;
342344
@@ -346,6 +348,9 @@ private SyncStorageEngine(Context context, File dataDir) {
346348
347349 mCal = Calendar .getInstance (TimeZone .getTimeZone ("GMT+0" ));
348350
351+ mDefaultMasterSyncAutomatically = mContext .getResources ().getBoolean (
352+ com .android .internal .R .bool .config_syncstorageengine_masterSyncAutomatically );
353+
349354 File systemDir = new File (dataDir , "system" );
350355 File syncDir = new File (systemDir , "sync" );
351356 syncDir .mkdirs ();
@@ -781,7 +786,7 @@ public void setMasterSyncAutomatically(boolean flag, int userId) {
781786 public boolean getMasterSyncAutomatically (int userId ) {
782787 synchronized (mAuthorities ) {
783788 Boolean auto = mMasterSyncAutomatically .get (userId );
784- return auto == null ? true : auto ;
789+ return auto == null ? mDefaultMasterSyncAutomatically : auto ;
785790 }
786791 }
787792
0 commit comments