public boolean startSync(int syncMode) {
    if (notesSyncManager == null) {
      return false;
    }
    if (accountManager.isLocalMode()) {
      return false;
    }

    if (!manualSync || syncMode == SyncMode.MANUAL) {
      notesSyncManager.sync(syncMode);
      return true;
    }
    return false;
  }
 @Override
 public void onCreate() {
   super.onCreate();
   dbHelper.getWritableDatabase();
   mi = ck(this);
   accountManager = new INotesAccountManager(this);
   accountManager.init();
   initMkDirs();
   initSetting();
   initTargetHeightWidth();
   registerNetWorkState();
   backgroundTaskManager = new BackgroundTaskManager(30000);
   resetSyncManager();
 }
 public long getCurrentAccountId() {
   return accountManager.getAccountId();
 }