mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 08:32:16 +01:00
Added setting to use unmetered connections only
This commit is contained in:
@@ -22,22 +22,14 @@ package eu.faircode.email;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
public class ReceiverAutostart extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(final Context context, Intent intent) {
|
||||
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) ||
|
||||
Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction()))
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int synchronizing = DB.getInstance(context).account().getSynchronizingAccountCount();
|
||||
Log.i(Helper.TAG, "Synchronizing accounts=" + synchronizing);
|
||||
if (synchronizing > 0)
|
||||
ServiceSynchronize.init(context);
|
||||
JobDaily.schedule(context);
|
||||
}
|
||||
}).start();
|
||||
Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())) {
|
||||
EntityLog.log(context, intent.getAction());
|
||||
ServiceSynchronize.init(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user