diff options
author | John Wang <johnwang@google.com> | 2010-09-03 11:38:31 -0700 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2010-09-08 15:50:57 -0700 |
commit | a48dc39bd55c5ddcd991e08f791fd18d94a0db12 (patch) | |
tree | 84e3f37321a20eb226d7d3a7745d17370fc273ac /telephony/java | |
parent | 65634a7935ed6f173179e7ac91a05288693b2bbf (diff) | |
download | frameworks_base-a48dc39bd55c5ddcd991e08f791fd18d94a0db12.zip frameworks_base-a48dc39bd55c5ddcd991e08f791fd18d94a0db12.tar.gz frameworks_base-a48dc39bd55c5ddcd991e08f791fd18d94a0db12.tar.bz2 |
Add hangupForegroundResumeBackground().
To fix bug 2968310.
Handle the operation of hangupForegroundResumeBackground while foreground call and background call come from different phones.
Change-Id: Id83ca1b75031a8391c95c7f8b2be40e9067dd4cd
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/CallManager.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java index c1232e8..caec7e1 100644 --- a/telephony/java/com/android/internal/telephony/CallManager.java +++ b/telephony/java/com/android/internal/telephony/CallManager.java @@ -466,6 +466,33 @@ public final class CallManager { } /** + * Hangup foreground call and resume the specific background call + * + * Note: this is noop if there is no foreground call or the heldCall is null + * + * @param heldCall to become foreground + * @throws CallStateException + */ + public void hangupForegroundResumeBackground(Call heldCall) throws CallStateException { + Phone foregroundPhone = null; + Phone backgroundPhone = null; + + if (hasActiveFgCall()) { + foregroundPhone = getFgPhone(); + if (heldCall != null) { + backgroundPhone = heldCall.getPhone(); + if (foregroundPhone == backgroundPhone) { + getActiveFgCall().hangup(); + } else { + // the call to be hangup and resumed belongs to different phones + getActiveFgCall().hangup(); + switchHoldingAndActive(heldCall); + } + } + } + } + + /** * Whether or not the phone can conference in the current phone * state--that is, one call holding and one call active. * @return true if the phone can conference; false otherwise. |