Add hangupForegroundResumeBackground().

To fix bug 2968310.

Handle the operation of hangupForegroundResumeBackground while foreground call and background call come from different phones.

Change-Id: Id83ca1b75031a8391c95c7f8b2be40e9067dd4cd
This commit is contained in:
John Wang
2010-09-03 11:38:31 -07:00
parent 65634a7935
commit a48dc39bd5

View File

@@ -465,6 +465,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.