Merge change 22048 into eclair

* changes:
  Add checks to avoid NPE's while stopping services
This commit is contained in:
Android (Google) Code Review 2009-08-20 09:05:31 -07:00
commit 4399ead9f4

View File

@ -983,9 +983,13 @@ public class SyncManager extends Service implements Runnable {
// Shut down all of those running services
for (Long mailboxId : toStop) {
AbstractSyncService svc = mServiceMap.get(mailboxId);
log("Shutting down " + svc.mAccount.mDisplayName + '/' + svc.mMailbox.mDisplayName);
svc.stop();
svc.mThread.interrupt();
if (svc != null) {
log("Stopping " + svc.mAccount.mDisplayName + '/' + svc.mMailbox.mDisplayName);
svc.stop();
if (svc.mThread != null) {
svc.mThread.interrupt();
}
}
releaseWakeLock(mailboxId);
}
}