Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc51f2c9 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

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
parent 8544560c
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -172,7 +172,7 @@ public final class SipService extends ISipService.Stub {
        SipSessionGroupExt group = mSipGroups.remove(localProfileUri);
        SipSessionGroupExt group = mSipGroups.remove(localProfileUri);
        if (group != null) {
        if (group != null) {
            notifyProfileRemoved(group.getLocalProfile());
            notifyProfileRemoved(group.getLocalProfile());
            group.closeToNotReceiveCalls();
            group.close();
            if (isWifiOn() && !anyOpened()) releaseWifiLock();
            if (isWifiOn() && !anyOpened()) releaseWifiLock();
        }
        }
    }
    }
@@ -449,9 +449,9 @@ public final class SipService extends ISipService.Stub {
            }
            }
        }
        }


        public void closeToNotReceiveCalls() {
        public void close() {
            mOpened = false;
            mOpened = false;
            mSipGroup.closeToNotReceiveCalls();
            mSipGroup.close();
            mAutoRegistration.stop();
            mAutoRegistration.stop();
            if (DEBUG) Log.d(TAG, "   close: " + getUri() + ": "
            if (DEBUG) Log.d(TAG, "   close: " + getUri() + ": "
                    + mIncomingCallBroadcastAction);
                    + mIncomingCallBroadcastAction);