From fc51f2c972c7a3a829f556c4c19f16c60c87d7e7 Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Wed, 22 Sep 2010 23:51:57 +0800 Subject: [PATCH] SipService: fix thread/socket leak Should call SipSessionGroup.close() instead of closeNotToReceiveCalls() to stop the SIP stack (which will stop the MessageProcessor thread and close its socket). Might be related to ANR's reported by: http://b/issue?id=3021924 http://b/issue?id=3021927 Change-Id: I4ead1d81fc9abac983f5753b825d20bc1cc79866 --- services/java/com/android/server/sip/SipService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/java/com/android/server/sip/SipService.java b/services/java/com/android/server/sip/SipService.java index a2ebc696b9d38..f1dcd5a6dd258 100644 --- a/services/java/com/android/server/sip/SipService.java +++ b/services/java/com/android/server/sip/SipService.java @@ -172,7 +172,7 @@ public final class SipService extends ISipService.Stub { SipSessionGroupExt group = mSipGroups.remove(localProfileUri); if (group != null) { notifyProfileRemoved(group.getLocalProfile()); - group.closeToNotReceiveCalls(); + group.close(); if (isWifiOn() && !anyOpened()) releaseWifiLock(); } } @@ -449,9 +449,9 @@ public final class SipService extends ISipService.Stub { } } - public void closeToNotReceiveCalls() { + public void close() { mOpened = false; - mSipGroup.closeToNotReceiveCalls(); + mSipGroup.close(); mAutoRegistration.stop(); if (DEBUG) Log.d(TAG, " close: " + getUri() + ": " + mIncomingCallBroadcastAction);