summaryrefslogtreecommitdiffstats
path: root/voip/java
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-10-22 06:01:29 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-22 06:01:29 -0700
commit2754b4bde824bfbdc483ad627aaaea87971b053a (patch)
tree191308eb508602b901248ed664e5ea257320742a /voip/java
parent1272c8b76b91103648dda7a8ac30f3f14e16782d (diff)
parentd4d3f36f4c25b41f4253eadd5e67035fe220cad3 (diff)
downloadframeworks_base-2754b4bde824bfbdc483ad627aaaea87971b053a.zip
frameworks_base-2754b4bde824bfbdc483ad627aaaea87971b053a.tar.gz
frameworks_base-2754b4bde824bfbdc483ad627aaaea87971b053a.tar.bz2
am d4d3f36f: am 1257d330: Merge "Clean up pending sessions on incoming call in SipService" into gingerbread
Merge commit 'd4d3f36f4c25b41f4253eadd5e67035fe220cad3' * commit 'd4d3f36f4c25b41f4253eadd5e67035fe220cad3': Clean up pending sessions on incoming call in SipService
Diffstat (limited to 'voip/java')
-rw-r--r--voip/java/com/android/server/sip/SipService.java15
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.