diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-10-22 09:01:49 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-10-22 09:01:49 +0800 |
commit | 60c45d026907edbe340c8cf9e1723b3dd34f8b6a (patch) | |
tree | bacf8d9cafdfb3afa8af7f7537d7bead5b42bf99 /voip | |
parent | 0c636055351f2e1d26138cf7b3bf3c82553e68c4 (diff) | |
download | frameworks_base-60c45d026907edbe340c8cf9e1723b3dd34f8b6a.zip frameworks_base-60c45d026907edbe340c8cf9e1723b3dd34f8b6a.tar.gz frameworks_base-60c45d026907edbe340c8cf9e1723b3dd34f8b6a.tar.bz2 |
Clean up pending sessions on incoming call in SipService
Bug: 3122186
Change-Id: I25c9aa19d138f6940a29025d54e7bc2ffb7daa29
Diffstat (limited to 'voip')
-rw-r--r-- | voip/java/com/android/server/sip/SipService.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/voip/java/com/android/server/sip/SipService.java b/voip/java/com/android/server/sip/SipService.java index 84e0803..f480fec 100644 --- a/voip/java/com/android/server/sip/SipService.java +++ b/voip/java/com/android/server/sip/SipService.java @@ -441,13 +441,26 @@ public final class SipService extends ISipService.Stub { private synchronized void addPendingSession(ISipSession session) { try { + cleanUpPendingSessions(); mPendingSessions.put(session.getCallId(), session); + if (DEBUG) Log.d(TAG, "#pending sess=" + mPendingSessions.size()); } catch (RemoteException e) { // should not happen with a local call Log.e(TAG, "addPendingSession()", e); } } + private void cleanUpPendingSessions() throws RemoteException { + Map.Entry<String, ISipSession>[] entries = + mPendingSessions.entrySet().toArray( + new Map.Entry[mPendingSessions.size()]); + for (Map.Entry<String, ISipSession> entry : entries) { + if (entry.getValue().getState() != SipSession.State.INCOMING_CALL) { + mPendingSessions.remove(entry.getKey()); + } + } + } + private synchronized boolean callingSelf(SipSessionGroupExt ringingGroup, SipSessionGroup.SipSessionImpl ringingSession) { String callId = ringingSession.getCallId(); @@ -1095,8 +1108,6 @@ public final class SipService extends ISipService.Stub { } } - // TODO: clean up pending SipSession(s) periodically - /** * Timer that can schedule events to occur even when the device is in sleep. * Only used internally in this package. |