mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
always start threads on app start (Timer.onReceive() may try it again, however)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user