Skip to content

Commit

Permalink
Move start-up sync from IsiActivity (main screen) to app-wide startup
Browse files Browse the repository at this point in the history
  • Loading branch information
yukuku committed Jul 16, 2015
1 parent 696388b commit a5b8f5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Alkitab/src/main/java/yuku/alkitab/base/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.model.SyncShadow;
import yuku.alkitab.base.model.VersionImpl;
import yuku.alkitab.base.storage.Prefkey;
import yuku.alkitab.base.sync.Gcm;
import yuku.alkitab.base.sync.Sync;
import yuku.alkitab.debug.R;
Expand Down Expand Up @@ -128,6 +130,11 @@ public synchronized static void staticInit() {

// make sure launcher do not open other variants of the app
Launcher.setAppPackageName(context.getPackageName());

// sync on app start, if we are logged in
if (Preferences.contains(Prefkey.sync_simpleToken)) {
Sync.notifySyncNeeded(SyncShadow.ALL_SYNC_SET_NAMES);
}
}

private static void forceOverflowMenu() {
Expand Down
5 changes: 0 additions & 5 deletions Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,6 @@ public void onReceive(final Context context, final Intent intent) {

App.getLbm().registerReceiver(reloadAttributeMapReceiver, new IntentFilter(ACTION_ATTRIBUTE_MAP_CHANGED));

// sync on app start, if we are logged in
if (Preferences.contains(Prefkey.sync_simpleToken)) {
Sync.notifySyncNeeded(SyncShadow.ALL_SYNC_SET_NAMES);
}

if (!U.equals(getPackageName(), "yuku.alkitab") /* prevent self-import */
&& !U.equals(getPackageName(), "yuku.alkitab.kjv") /* prevent self-import */
&& Preferences.getInt(Prefkey.stop_import_yuku_alkitab_backups, 0) == 0
Expand Down

0 comments on commit a5b8f5a

Please sign in to comment.