Revert "Fix strict mode violation in maybeStartExchangeServiceThread"

This reverts commit 0e1ffb033a.
This commit is contained in:
Marc Blank 2010-10-27 17:13:53 -07:00
parent dac9c15266
commit 13fe88f38d

View File

@ -1785,30 +1785,17 @@ public class ExchangeService extends Service implements Runnable {
} }
void maybeStartExchangeServiceThread() { void maybeStartExchangeServiceThread() {
synchronized (sSyncLock) {
// Start our thread... // Start our thread...
// See if there are any EAS accounts; otherwise, just go away // See if there are any EAS accounts; otherwise, just go away
if (sServiceThread != null || sServiceThread.isAlive()) { if (EmailContent.count(this, HostAuth.CONTENT_URI, WHERE_PROTOCOL_EAS, null) > 0) {
return; if (sServiceThread == null || !sServiceThread.isAlive()) {
} log(sServiceThread == null ? "Starting thread..." : "Restarting thread...");
}
final ExchangeService service = this;
Utility.runAsync(new Runnable() {
@Override
public void run() {
synchronized (sSyncLock) {
if (EmailContent.count(service, HostAuth.CONTENT_URI,
WHERE_PROTOCOL_EAS, null) > 0) {
log(sServiceThread == null ? "Starting thread..."
: "Restarting thread...");
sServiceThread = new Thread(this, "ExchangeService"); sServiceThread = new Thread(this, "ExchangeService");
INSTANCE = service; INSTANCE = this;
sServiceThread.start(); sServiceThread.start();
} }
} }
} }
});
}
/** /**
* Start up the ExchangeService service if it's not already running * Start up the ExchangeService service if it's not already running