summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-10-21 10:56:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-21 10:56:02 -0700
commit821f087989a75ce9e04dc8dcc99b227fde0a0e28 (patch)
treee2e3a07cbc26f8b8b60adbe167477f6d490509d4 /telephony
parentb37cc33030b0ecfd5a7719387c2e00a1a6262d49 (diff)
parentfd0ba81c02c0881f7534333afc8c53e241158a3d (diff)
downloadframeworks_base-821f087989a75ce9e04dc8dcc99b227fde0a0e28.zip
frameworks_base-821f087989a75ce9e04dc8dcc99b227fde0a0e28.tar.gz
frameworks_base-821f087989a75ce9e04dc8dcc99b227fde0a0e28.tar.bz2
am fd0ba81c: am baced375: Merge "Silently reject a ringing call when another call is dialing/ringing." into gingerbread
Merge commit 'fd0ba81c02c0881f7534333afc8c53e241158a3d' * commit 'fd0ba81c02c0881f7534333afc8c53e241158a3d': Silently reject a ringing call when another call is dialing/ringing.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/CallManager.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java
index 3f0ec0a..ab7b601 100644
--- a/telephony/java/com/android/internal/telephony/CallManager.java
+++ b/telephony/java/com/android/internal/telephony/CallManager.java
@@ -1626,7 +1626,15 @@ public final class CallManager {
}
-
+ private boolean hasMoreThanOneRingingCall() {
+ int count = 0;
+ for (Call call : mRingingCalls) {
+ if (call.getState().isRinging()) {
+ if (++count > 1) return true;
+ }
+ }
+ return false;
+ }
private Handler mHandler = new Handler() {
@@ -1644,7 +1652,17 @@ public final class CallManager {
break;
case EVENT_NEW_RINGING_CONNECTION:
if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_NEW_RINGING_CONNECTION)");
- mNewRingingConnectionRegistrants.notifyRegistrants((AsyncResult) msg.obj);
+ if (getActiveFgCallState().isDialing() || hasMoreThanOneRingingCall()) {
+ Connection c = (Connection) ((AsyncResult) msg.obj).result;
+ try {
+ Log.d(LOG_TAG, "silently drop incoming call: " + c.getCall());
+ c.getCall().hangup();
+ } catch (CallStateException e) {
+ Log.w(LOG_TAG, "new ringing connection", e);
+ }
+ } else {
+ mNewRingingConnectionRegistrants.notifyRegistrants((AsyncResult) msg.obj);
+ }
break;
case EVENT_UNKNOWN_CONNECTION:
if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_UNKNOWN_CONNECTION)");