Loading src/java/com/android/internal/telephony/imsphone/ImsPhone.java +12 −2 Original line number Diff line number Diff line Loading @@ -681,8 +681,18 @@ public class ImsPhone extends ImsPhoneBase { if (getRingingCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: accept ringing call"); mCT.acceptCall(ImsCallProfile.CALL_TYPE_VOICE); } else if (getBackgroundCall().getState() == ImsPhoneCall.State.HOLDING) { // If there's an active ongoing call as well, hold it and the background one // should automatically unhold. Otherwise just unhold the background call. if (getForegroundCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: switch holding and active"); mCT.holdActiveCall(); } else { if (DBG) logd("MmiCode 2: holdActiveCall"); if (DBG) logd("MmiCode 2: unhold held call"); mCT.unholdHeldCall(); } } else if (getForegroundCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: hold active call"); mCT.holdActiveCall(); } } catch (CallStateException e) { Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -1347,7 +1347,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { /** * Unhold the currently held call. */ void unholdHeldCall() throws CallStateException { public void unholdHeldCall() throws CallStateException { ImsCall imsCall = mBackgroundCall.getImsCall(); if (mHoldSwitchingState == HoldSwapState.PENDING_SINGLE_CALL_UNHOLD || mHoldSwitchingState == HoldSwapState.SWAPPING_ACTIVE_AND_HELD) { Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneTest.java +15 −1 Original line number Diff line number Diff line Loading @@ -223,11 +223,25 @@ public class ImsPhoneTest extends TelephonyTest { assertEquals(Phone.SuppService.SEPARATE, ((AsyncResult) messageArgumentCaptor.getValue().obj).result); // ringing call is idle // ringing call is idle, only an active call present doReturn(Call.State.ACTIVE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).holdActiveCall(); // background call is holding doReturn(Call.State.HOLDING).when(mBackgroundCall).getState(); doReturn(Call.State.IDLE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).unholdHeldCall(); // background call is holding and there's an active foreground call doReturn(Call.State.ACTIVE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT, times(2)).holdActiveCall(); // ringing call is not idle doReturn(Call.State.IDLE).when(mForegroundCall).getState(); doReturn(Call.State.IDLE).when(mBackgroundCall).getState(); doReturn(Call.State.INCOMING).when(mRingingCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).acceptCall(ImsCallProfile.CALL_TYPE_VOICE); Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhone.java +12 −2 Original line number Diff line number Diff line Loading @@ -681,8 +681,18 @@ public class ImsPhone extends ImsPhoneBase { if (getRingingCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: accept ringing call"); mCT.acceptCall(ImsCallProfile.CALL_TYPE_VOICE); } else if (getBackgroundCall().getState() == ImsPhoneCall.State.HOLDING) { // If there's an active ongoing call as well, hold it and the background one // should automatically unhold. Otherwise just unhold the background call. if (getForegroundCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: switch holding and active"); mCT.holdActiveCall(); } else { if (DBG) logd("MmiCode 2: holdActiveCall"); if (DBG) logd("MmiCode 2: unhold held call"); mCT.unholdHeldCall(); } } else if (getForegroundCall().getState() != ImsPhoneCall.State.IDLE) { if (DBG) logd("MmiCode 2: hold active call"); mCT.holdActiveCall(); } } catch (CallStateException e) { Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -1347,7 +1347,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { /** * Unhold the currently held call. */ void unholdHeldCall() throws CallStateException { public void unholdHeldCall() throws CallStateException { ImsCall imsCall = mBackgroundCall.getImsCall(); if (mHoldSwitchingState == HoldSwapState.PENDING_SINGLE_CALL_UNHOLD || mHoldSwitchingState == HoldSwapState.SWAPPING_ACTIVE_AND_HELD) { Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneTest.java +15 −1 Original line number Diff line number Diff line Loading @@ -223,11 +223,25 @@ public class ImsPhoneTest extends TelephonyTest { assertEquals(Phone.SuppService.SEPARATE, ((AsyncResult) messageArgumentCaptor.getValue().obj).result); // ringing call is idle // ringing call is idle, only an active call present doReturn(Call.State.ACTIVE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).holdActiveCall(); // background call is holding doReturn(Call.State.HOLDING).when(mBackgroundCall).getState(); doReturn(Call.State.IDLE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).unholdHeldCall(); // background call is holding and there's an active foreground call doReturn(Call.State.ACTIVE).when(mForegroundCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT, times(2)).holdActiveCall(); // ringing call is not idle doReturn(Call.State.IDLE).when(mForegroundCall).getState(); doReturn(Call.State.IDLE).when(mBackgroundCall).getState(); doReturn(Call.State.INCOMING).when(mRingingCall).getState(); assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2")); verify(mImsCT).acceptCall(ImsCallProfile.CALL_TYPE_VOICE); Loading