mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
make new folder options work
This commit is contained in:
parent
87192dca99
commit
66ea30f75e
6 changed files with 76 additions and 12 deletions
|
@ -198,8 +198,8 @@ android {
|
|||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode 404
|
||||
versionName "0.92.0"
|
||||
versionCode 405
|
||||
versionName "0.93.0"
|
||||
applicationId "chat.delta.androidii"
|
||||
|
||||
minSdkVersion 14
|
||||
|
|
|
@ -899,6 +899,7 @@ messenger-backend/src/dc_dehtml.c \
|
|||
messenger-backend/src/dc_hash.c \
|
||||
messenger-backend/src/dc_imap.c \
|
||||
messenger-backend/src/dc_job.c \
|
||||
messenger-backend/src/dc_jobthread.c \
|
||||
messenger-backend/src/dc_key.c \
|
||||
messenger-backend/src/dc_keyring.c \
|
||||
messenger-backend/src/dc_loginparam.c \
|
||||
|
|
|
@ -262,6 +262,24 @@ JNIEXPORT void Java_com_b44t_messenger_DcContext_interruptImapIdle(JNIEnv *env,
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_performSentboxFetch(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dc_perform_sentbox_fetch(get_dc_context(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_performSentboxIdle(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dc_perform_sentbox_idle(get_dc_context(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_interruptSentboxIdle(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dc_interrupt_sentbox_idle(get_dc_context(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_performMvboxFetch(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dc_perform_mvbox_fetch(get_dc_context(env, obj));
|
||||
|
|
|
@ -72,6 +72,9 @@ public class DcContext {
|
|||
public native void performMvboxFetch ();
|
||||
public native void performMvboxIdle ();
|
||||
public native void interruptMvboxIdle ();
|
||||
public native void performSentboxFetch ();
|
||||
public native void performSentboxIdle ();
|
||||
public native void interruptSentboxIdle ();
|
||||
public native void performSmtpJobs ();
|
||||
public native void performSmtpIdle ();
|
||||
public native void maybeNetwork ();
|
||||
|
|
|
@ -75,6 +75,9 @@ public class ApplicationDcContext extends DcContext {
|
|||
mvboxWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "mvboxWakeLock");
|
||||
mvboxWakeLock.setReferenceCounted(false); // if the idle-thread is killed for any reasons, it is better not to rely on reference counting
|
||||
|
||||
sentboxWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "sentboxWakeLock");
|
||||
sentboxWakeLock.setReferenceCounted(false); // if the idle-thread is killed for any reasons, it is better not to rely on reference counting
|
||||
|
||||
smtpWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "smtpWakeLock");
|
||||
smtpWakeLock.setReferenceCounted(false); // if the idle-thread is killed for any reasons, it is better not to rely on reference counting
|
||||
|
||||
|
@ -269,6 +272,11 @@ public class ApplicationDcContext extends DcContext {
|
|||
public Thread mvboxThread = null;
|
||||
private PowerManager.WakeLock mvboxWakeLock = null;
|
||||
|
||||
private boolean sentboxThreadStartedVal;
|
||||
private final Object sentboxThreadStartedCond = new Object();
|
||||
public Thread sentboxThread = null;
|
||||
private PowerManager.WakeLock sentboxWakeLock = null;
|
||||
|
||||
private boolean smtpThreadStartedVal;
|
||||
private final Object smtpThreadStartedCond = new Object();
|
||||
public Thread smtpThread = null;
|
||||
|
@ -349,6 +357,38 @@ public class ApplicationDcContext extends DcContext {
|
|||
}
|
||||
|
||||
|
||||
if (sentboxThread == null || !sentboxThread.isAlive()) {
|
||||
|
||||
synchronized (sentboxThreadStartedCond) {
|
||||
sentboxThreadStartedVal = false;
|
||||
}
|
||||
|
||||
sentboxThread = new Thread(() -> {
|
||||
sentboxWakeLock.acquire();
|
||||
synchronized (sentboxThreadStartedCond) {
|
||||
sentboxThreadStartedVal = true;
|
||||
sentboxThreadStartedCond.notifyAll();
|
||||
}
|
||||
|
||||
Log.i(TAG, "###################### SENTBOX-Thread started. ######################");
|
||||
|
||||
|
||||
while (true) {
|
||||
sentboxWakeLock.acquire();
|
||||
performSentboxFetch();
|
||||
sentboxWakeLock.release();
|
||||
performSentboxIdle();
|
||||
}
|
||||
}, "sentboxThread");
|
||||
sentboxThread.setPriority(Thread.NORM_PRIORITY-1);
|
||||
sentboxThread.start();
|
||||
} else {
|
||||
if ((flags & INTERRUPT_IDLE) != 0) {
|
||||
interruptSentboxIdle();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (smtpThread == null || !smtpThread.isAlive()) {
|
||||
|
||||
synchronized (smtpThreadStartedCond) {
|
||||
|
@ -392,6 +432,12 @@ public class ApplicationDcContext extends DcContext {
|
|||
}
|
||||
}
|
||||
|
||||
synchronized (sentboxThreadStartedCond) {
|
||||
while (!sentboxThreadStartedVal) {
|
||||
sentboxThreadStartedCond.wait();
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (smtpThreadStartedCond) {
|
||||
while (!smtpThreadStartedVal) {
|
||||
smtpThreadStartedCond.wait();
|
||||
|
|
|
@ -62,20 +62,16 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment
|
|||
|
||||
inboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_inbox_watch");
|
||||
inboxWatchCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
// boolean enabled = (Boolean) newValue;
|
||||
// dcContext.setConfigInt("inbox_watch", enabled? 1 : 0);
|
||||
// return true;
|
||||
Toast.makeText(getActivity(), "Not yet implemented.", Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
boolean enabled = (Boolean) newValue;
|
||||
dcContext.setConfigInt("inbox_watch", enabled? 1 : 0);
|
||||
return true;
|
||||
});
|
||||
|
||||
sentboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_sentbox_watch");
|
||||
sentboxWatchCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
// boolean enabled = (Boolean) newValue;
|
||||
// dcContext.setConfigInt("sentbox_watch", enabled? 1 : 0);
|
||||
// return true;
|
||||
Toast.makeText(getActivity(), "Not yet implemented.", Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
boolean enabled = (Boolean) newValue;
|
||||
dcContext.setConfigInt("sentbox_watch", enabled? 1 : 0);
|
||||
return true;
|
||||
});
|
||||
|
||||
mvboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_mvbox_watch");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue