From 0cf741bb0a73d76a07aac6a062f2909ed341b158 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 7 Apr 2010 09:40:19 -0700 Subject: [PATCH] Fix bug #2551196 * Handle the case in which a Mailbox to be synced doesn't have a serverId (rare case which happened to a Zimbra user) * Tweak logging to improve debugability of similar issues Bug: 2551196 Change-Id: Id61cee5c4b33eb2f87455fbae0899fec8ff3748f --- src/com/android/exchange/SyncManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java index 043411b79..e93d6e02c 100644 --- a/src/com/android/exchange/SyncManager.java +++ b/src/com/android/exchange/SyncManager.java @@ -1598,7 +1598,7 @@ public class SyncManager extends Service implements Runnable { thread.start(); mServiceMap.put(m.mId, service); runAwake(m.mId); - if (!m.mServerId.startsWith(Eas.ACCOUNT_MAILBOX_PREFIX)) { + if ((m.mServerId != null) && !m.mServerId.startsWith(Eas.ACCOUNT_MAILBOX_PREFIX)) { stopPing(m.mAccountKey); } } @@ -1782,9 +1782,12 @@ public class SyncManager extends Service implements Runnable { } } } - stopServiceThreads(); log("Shutdown requested"); + } catch (RuntimeException e) { + Log.e(TAG, "RuntimeException in SyncManager", e); + throw e; } finally { + log("Finishing SyncManager"); // Lots of cleanup here // Stop our running syncs stopServiceThreads();