Merge commit 'ea878be11729cd793d9183fc264118241cd5a5b6' into eclair-plus-aosp * commit 'ea878be11729cd793d9183fc264118241cd5a5b6': Make sure we hold WakeLock during mail sending (fixes #2180551)
This commit is contained in:
commit
bf7b721709
@ -408,6 +408,7 @@ public class EasSyncService extends AbstractSyncService {
|
|||||||
protected HttpResponse sendHttpClientPost(String cmd, HttpEntity entity, int timeout)
|
protected HttpResponse sendHttpClientPost(String cmd, HttpEntity entity, int timeout)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
HttpClient client = getHttpClient(timeout);
|
HttpClient client = getHttpClient(timeout);
|
||||||
|
boolean sleepAllowed = cmd.equals(PING_COMMAND);
|
||||||
|
|
||||||
// Split the mail sending commands
|
// Split the mail sending commands
|
||||||
String extra = null;
|
String extra = null;
|
||||||
@ -432,13 +433,17 @@ public class EasSyncService extends AbstractSyncService {
|
|||||||
method.setEntity(entity);
|
method.setEntity(entity);
|
||||||
synchronized(getSynchronizer()) {
|
synchronized(getSynchronizer()) {
|
||||||
mPendingPost = method;
|
mPendingPost = method;
|
||||||
SyncManager.runAsleep(mMailboxId, timeout+(10*SECONDS));
|
if (sleepAllowed) {
|
||||||
|
SyncManager.runAsleep(mMailboxId, timeout+(10*SECONDS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return client.execute(method);
|
return client.execute(method);
|
||||||
} finally {
|
} finally {
|
||||||
synchronized(getSynchronizer()) {
|
synchronized(getSynchronizer()) {
|
||||||
SyncManager.runAwake(mMailboxId);
|
if (sleepAllowed) {
|
||||||
|
SyncManager.runAwake(mMailboxId);
|
||||||
|
}
|
||||||
mPendingPost = null;
|
mPendingPost = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user