always start threads on app start (Timer.onReceive() may try it again, however)

This commit is contained in:
B. Petersen
2018-06-19 17:38:27 +02:00
parent 1f63c2a5da
commit 1d66dd937b
3 changed files with 7 additions and 7 deletions
@@ -219,7 +219,7 @@ public class ApplicationLoader extends Application {
// open() should be called before MessagesController.getInstance() as this also initilizes directories based upon getBlobdir().
File dbfile = new File(getFilesDirFixed(), "messenger.db");
MrMailbox.open(dbfile.getAbsolutePath());
if( MrMailbox.isConfigured()!=0 && ApplicationLoader.getPermanentPush() ) {
if( MrMailbox.isConfigured()!=0 /*&& ApplicationLoader.getPermanentPush()*/ ) {
//ApplicationLoader.imapForeground = true;
ApplicationLoader.startThreads();
}
@@ -395,12 +395,12 @@ public class ApplicationLoader extends Application {
}
}
public static void scheduleStopImapThread()
/*public static void scheduleStopImapThread()
{
//Log.i("DeltaChat", "IMAP-thread scheduled to stop.");
//imapForeground = false;
//MrMailbox.interruptIdle();
}
}*/
}
@@ -99,9 +99,9 @@ public class ForegroundDetector implements Application.ActivityLifecycleCallback
enterBackgroundTime = System.currentTimeMillis();
wasInBackground = true;
if( !ApplicationLoader.getPermanentPush() ) {
/*if( !ApplicationLoader.getPermanentPush() ) {
ApplicationLoader.scheduleStopImapThread();;
}
}*/
}
else {
Log.i("DeltaChat", String.format("Not yet switched to background, %d activities left", refs));
@@ -37,9 +37,9 @@ public class ScreenReceiver extends BroadcastReceiver {
ApplicationLoader.isScreenOn = false;
// also stop the idle-thread when the screen goes off, this is not always in sync with the ForegroundDetector
if( !ApplicationLoader.getPermanentPush() ) {
/*if( !ApplicationLoader.getPermanentPush() ) {
ApplicationLoader.scheduleStopImapThread();
}
}*/
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
MrMailbox.log_i("DeltaChat", "-------------------- Screen on --------------------");
ApplicationLoader.isScreenOn = true;