diff --git a/AndroidManifest.xml b/AndroidManifest.xml index eb09ed852..a1b674380 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -207,6 +207,9 @@ + + + dark + + @string/background_ops_enabled + @string/background_ops_always + @string/background_ops_never + + + WHEN_CHECKED + ALWAYS + NEVER + + diff --git a/res/values/strings.xml b/res/values/strings.xml index a7281f8d0..3f425b025 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -533,5 +533,12 @@ Welcome to K-9 Mail setup. K-9 is an open source email client for Android based Light Display Preferences Diagnostic Preferences + Operational Preferences Theme + + Background synchronization + Never + Always + When Background data is checked + diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index b00b11443..66a372b51 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -25,6 +25,16 @@ android:entryValues="@array/settings_theme_values" android:dialogTitle="@string/settings_theme_label" /> + + + + + pushers = MessagingController.getInstance(getApplication()).getPushers(); @@ -203,21 +220,15 @@ public class MailService extends Service { Log.e(Email.LOG_TAG, "Exception while refreshing pushers", e); } } - else if (CONNECTIVITY_CHANGE.equals(intent.getAction())) + else if (CONNECTIVITY_CHANGE.equals(intent.getAction()) || + BACKGROUND_DATA_CHANGED.equals(intent.getAction())) { + actionReschedule(this); boolean hasConnectivity = intent.getBooleanExtra(HAS_CONNECTIVITY, true); - Log.i(Email.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity); + + Log.i(Email.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground); + notifyConnectionStatus(hasConnectivity); - if (hasConnectivity) - { - reschedulePushers(); - // TODO: Make it send pending outgoing messages here - //checkMail(getApplication()); - } - else - { - stopPushers(); - } } else if (CANCEL_CONNECTIVITY_NOTICE.equals(intent.getAction())) { @@ -313,7 +324,7 @@ public class MailService extends Service { try { String checkString = "Next check for package " + getApplication().getPackageName() + " scheduled for " + new Date(nextTime); - Log.v(Email.LOG_TAG, checkString); + Log.i(Email.LOG_TAG, checkString); MessagingController.getInstance(getApplication()).log(checkString); } catch (Exception e)