Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +9 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,15 @@ public class ImsPhoneCall extends Call { return mIsRingbackTonePlaying; } public void maybeClearRemotelyHeldStatus() { for (Connection conn : getConnections()) { ImsPhoneConnection c = (ImsPhoneConnection) conn; if (c.isHeldByRemote()) { c.setRemotelyUnheld(); } } } private void takeOver(ImsPhoneCall that) { copyConnectionFrom(that); mState = that.mState; Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +4 −2 Original line number Diff line number Diff line Loading @@ -4041,7 +4041,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mPhone.stopOnHoldTone(conn); mOnHoldToneStarted = false; } conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_UNHELD, null); conn.setRemotelyUnheld(); mImsCallInfoTracker.updateImsCallStatus(conn, false, true); } Loading Loading @@ -4722,6 +4722,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // If the dialing call had ringback, ensure it stops now, // otherwise it'll keep playing afer the SRVCC completes. mForegroundCall.maybeStopRingback(); mForegroundCall.maybeClearRemotelyHeldStatus(); mBackgroundCall.maybeClearRemotelyHeldStatus(); resetState(); transferHandoverConnections(mForegroundCall); Loading Loading @@ -5822,7 +5824,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mOnHoldToneStarted = true; mOnHoldToneId = System.identityHashCode(conn); } conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_HELD, null); conn.setRemotelyHeld(); mImsCallInfoTracker.updateImsCallStatus(conn, true, false); boolean useVideoPauseWorkaround = mPhone.getContext().getResources().getBoolean( Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +29 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,11 @@ public class ImsPhoneConnection extends Connection implements */ private ImsReasonInfo mImsReasonInfo; /** * Used to indicate that this call is held by remote party. */ private boolean mIsHeldByRemote = false; //***** Event Constants private static final int EVENT_DTMF_DONE = 1; private static final int EVENT_PAUSE_DONE = 2; Loading Loading @@ -1591,6 +1596,30 @@ public class ImsPhoneConnection extends Connection implements onConnectionEvent(android.telecom.Connection.EVENT_MERGE_COMPLETE, null); } /** * Mark the call is held by remote party and inform to the UI. */ public void setRemotelyHeld() { mIsHeldByRemote = true; onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_HELD, null); } /** * Mark the call is Unheld by remote party and inform to the UI. */ public void setRemotelyUnheld() { mIsHeldByRemote = false; onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_UNHELD, null); } /** * @return whether the remote party is holding the call. */ public boolean isHeldByRemote() { Rlog.i(LOG_TAG, "isHeldByRemote=" + mIsHeldByRemote); return mIsHeldByRemote; } public void changeToPausedState() { int newVideoState = getVideoState() | VideoProfile.STATE_PAUSED; Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToPausedState - setting paused bit; " Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -317,4 +317,24 @@ public class ImsPhoneCallTest extends TelephonyTest { fail("Exception unexpected"); } } @Test public void testMaybeClearRemotelyHeldStatus() { mImsCallUT.attach(mConnection1, Call.State.ACTIVE); when(mConnection1.isHeldByRemote()).thenReturn(true); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(1)).setRemotelyUnheld(); mImsCallUT.attach(mConnection2, Call.State.ACTIVE); when(mConnection2.isHeldByRemote()).thenReturn(true); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(2)).setRemotelyUnheld(); verify(mConnection2, times(1)).setRemotelyUnheld(); when(mConnection1.isHeldByRemote()).thenReturn(false); when(mConnection2.isHeldByRemote()).thenReturn(false); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(2)).setRemotelyUnheld(); verify(mConnection2, times(1)).setRemotelyUnheld(); } } Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +9 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,15 @@ public class ImsPhoneCall extends Call { return mIsRingbackTonePlaying; } public void maybeClearRemotelyHeldStatus() { for (Connection conn : getConnections()) { ImsPhoneConnection c = (ImsPhoneConnection) conn; if (c.isHeldByRemote()) { c.setRemotelyUnheld(); } } } private void takeOver(ImsPhoneCall that) { copyConnectionFrom(that); mState = that.mState; Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +4 −2 Original line number Diff line number Diff line Loading @@ -4041,7 +4041,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mPhone.stopOnHoldTone(conn); mOnHoldToneStarted = false; } conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_UNHELD, null); conn.setRemotelyUnheld(); mImsCallInfoTracker.updateImsCallStatus(conn, false, true); } Loading Loading @@ -4722,6 +4722,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // If the dialing call had ringback, ensure it stops now, // otherwise it'll keep playing afer the SRVCC completes. mForegroundCall.maybeStopRingback(); mForegroundCall.maybeClearRemotelyHeldStatus(); mBackgroundCall.maybeClearRemotelyHeldStatus(); resetState(); transferHandoverConnections(mForegroundCall); Loading Loading @@ -5822,7 +5824,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mOnHoldToneStarted = true; mOnHoldToneId = System.identityHashCode(conn); } conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_HELD, null); conn.setRemotelyHeld(); mImsCallInfoTracker.updateImsCallStatus(conn, true, false); boolean useVideoPauseWorkaround = mPhone.getContext().getResources().getBoolean( Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +29 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,11 @@ public class ImsPhoneConnection extends Connection implements */ private ImsReasonInfo mImsReasonInfo; /** * Used to indicate that this call is held by remote party. */ private boolean mIsHeldByRemote = false; //***** Event Constants private static final int EVENT_DTMF_DONE = 1; private static final int EVENT_PAUSE_DONE = 2; Loading Loading @@ -1591,6 +1596,30 @@ public class ImsPhoneConnection extends Connection implements onConnectionEvent(android.telecom.Connection.EVENT_MERGE_COMPLETE, null); } /** * Mark the call is held by remote party and inform to the UI. */ public void setRemotelyHeld() { mIsHeldByRemote = true; onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_HELD, null); } /** * Mark the call is Unheld by remote party and inform to the UI. */ public void setRemotelyUnheld() { mIsHeldByRemote = false; onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_UNHELD, null); } /** * @return whether the remote party is holding the call. */ public boolean isHeldByRemote() { Rlog.i(LOG_TAG, "isHeldByRemote=" + mIsHeldByRemote); return mIsHeldByRemote; } public void changeToPausedState() { int newVideoState = getVideoState() | VideoProfile.STATE_PAUSED; Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToPausedState - setting paused bit; " Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -317,4 +317,24 @@ public class ImsPhoneCallTest extends TelephonyTest { fail("Exception unexpected"); } } @Test public void testMaybeClearRemotelyHeldStatus() { mImsCallUT.attach(mConnection1, Call.State.ACTIVE); when(mConnection1.isHeldByRemote()).thenReturn(true); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(1)).setRemotelyUnheld(); mImsCallUT.attach(mConnection2, Call.State.ACTIVE); when(mConnection2.isHeldByRemote()).thenReturn(true); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(2)).setRemotelyUnheld(); verify(mConnection2, times(1)).setRemotelyUnheld(); when(mConnection1.isHeldByRemote()).thenReturn(false); when(mConnection2.isHeldByRemote()).thenReturn(false); mImsCallUT.maybeClearRemotelyHeldStatus(); verify(mConnection1, times(2)).setRemotelyUnheld(); verify(mConnection2, times(1)).setRemotelyUnheld(); } }