From 79ff660aa2b98b776c13b687b3bc9f7b93b78123 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Fri, 5 Nov 2010 20:35:14 -0700 Subject: [PATCH] Prevent unnecessary database queries in ExchangeService Change-Id: Idc3cbc272bd96598b7c7a5de644786bddf1ce03e --- src/com/android/exchange/ExchangeService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/exchange/ExchangeService.java b/src/com/android/exchange/ExchangeService.java index ff0cd3582..37ae4d3c0 100644 --- a/src/com/android/exchange/ExchangeService.java +++ b/src/com/android/exchange/ExchangeService.java @@ -1795,8 +1795,8 @@ public class ExchangeService extends Service implements Runnable { void maybeStartExchangeServiceThread() { // Start our thread... // See if there are any EAS accounts; otherwise, just go away - if (EmailContent.count(this, HostAuth.CONTENT_URI, WHERE_PROTOCOL_EAS, null) > 0) { - if (sServiceThread == null || !sServiceThread.isAlive()) { + if (sServiceThread == null || !sServiceThread.isAlive()) { + if (EmailContent.count(this, HostAuth.CONTENT_URI, WHERE_PROTOCOL_EAS, null) > 0) { log(sServiceThread == null ? "Starting thread..." : "Restarting thread..."); sServiceThread = new Thread(this, "ExchangeService"); INSTANCE = this;