am f7369ad5: Merge "Shutdown all connections when sync service is hung" into froyo
Merge commit 'f7369ad51f0eb2c231715975de13e4af37c58eb4' into froyo-plus-aosp
* commit 'f7369ad51f0eb2c231715975de13e4af37c58eb4':
Shutdown all connections when sync service is hung
diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java
index 9f528dd..e63394f 100644
--- a/src/com/android/exchange/SyncManager.java
+++ b/src/com/android/exchange/SyncManager.java
@@ -1177,6 +1177,11 @@
return sClientConnectionManager;
}
+ static private synchronized void shutdownConnectionManager() {
+ sClientConnectionManager.shutdown();
+ sClientConnectionManager = null;
+ }
+
public static void stopAccountSyncs(long acctId) {
SyncManager syncManager = INSTANCE;
if (syncManager != null) {
@@ -1448,6 +1453,9 @@
// thread to do the work
log("Alarm failed; releasing mailbox");
syncManager.releaseMailbox(id);
+ // Shutdown the connection manager; this should close all of our
+ // sockets and generate IOExceptions all around.
+ syncManager.shutdownConnectionManager();
}
}
}}).start();