Merge "Prevent unnecessary database queries in ExchangeService"

This commit is contained in:
Marc Blank 2010-11-05 20:36:19 -07:00 committed by Android (Google) Code Review
commit dc8f1afeb6

View File

@ -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;