use of android.telephony.ims.ImsCallProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTrackerTest method testNoRemoteHoldtone.
/**
* Tests that no hold tone is played if the call is remotely held and the media direction is
* send/receive (i.e. there is an audio stream present).
*/
@Test
@SmallTest
public void testNoRemoteHoldtone() {
// establish a MT call
testImsMTCallAccept();
ImsPhoneConnection connection = mCTUT.mForegroundCall.getFirstConnection();
ImsCall call = connection.getImsCall();
// Set the media direction to send/receive.
ImsCallProfile callProfile = new ImsCallProfile();
callProfile.mMediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE;
call.setCallProfile(callProfile);
try {
mCTUT.onCallHoldReceived(call);
} catch (Exception ex) {
ex.printStackTrace();
Assert.fail("unexpected exception thrown" + ex.getMessage());
}
verify(mImsPhone, never()).startOnHoldTone(nullable(Connection.class));
}
use of android.telephony.ims.ImsCallProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsCallTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp(getClass().getSimpleName());
mTestCallProfile = new ImsCallProfile();
mBundle = mTestCallProfile.mCallExtras;
}
use of android.telephony.ims.ImsCallProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTrackerTest method placeCallAndMakeActive.
private ImsPhoneConnection placeCallAndMakeActive() {
try {
doAnswer(new Answer<ImsCall>() {
@Override
public ImsCall answer(InvocationOnMock invocation) throws Throwable {
mImsCallListener = (ImsCall.Listener) invocation.getArguments()[2];
ImsCall imsCall = spy(new ImsCall(mContext, mImsCallProfile));
imsCall.setListener(mImsCallListener);
imsCallMocking(imsCall);
return imsCall;
}
}).when(mImsManager).makeCall(eq(mImsCallProfile), (String[]) any(), (ImsCall.Listener) any());
} catch (ImsException ie) {
}
ImsPhoneConnection connection = null;
try {
connection = (ImsPhoneConnection) mCTUT.dial("+16505551212", ImsCallProfile.CALL_TYPE_VOICE, null);
} catch (Exception ex) {
ex.printStackTrace();
Assert.fail("unexpected exception thrown" + ex.getMessage());
}
if (connection == null) {
Assert.fail("connection is null");
}
ImsCall imsCall = connection.getImsCall();
imsCall.getImsCallSessionListenerProxy().callSessionProgressing(imsCall.getSession(), new ImsStreamMediaProfile());
imsCall.getImsCallSessionListenerProxy().callSessionStarted(imsCall.getSession(), new ImsCallProfile());
return connection;
}
use of android.telephony.ims.ImsCallProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsCallTest method testNonNulllVideoProfile.
@Test
@SmallTest
public void testNonNulllVideoProfile() {
ImsCallProfile profile = new ImsCallProfile();
profile.mCallType = ImsCallProfile.CALL_TYPE_VT_TX;
ImsCall imsCall = new ImsCall(mContext, profile);
assertNotNull(imsCall);
assertTrue(imsCall.wasVideoCall());
}
use of android.telephony.ims.ImsCallProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTrackerTest method testRemoteHoldtone.
@Test
@SmallTest
public void testRemoteHoldtone() {
// Set carrier config to always play remote hold tone.
mCTUT.setAlwaysPlayRemoteHoldTone(true);
// establish a MT call
testImsMTCallAccept();
ImsPhoneConnection connection = mCTUT.mForegroundCall.getFirstConnection();
ImsCall call = connection.getImsCall();
// Set the media direction to send/receive; normally we don't play a hold tone but the
// carrier config option is set to ensure we will do it in this case.
ImsCallProfile callProfile = new ImsCallProfile();
callProfile.mMediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE;
call.setCallProfile(callProfile);
try {
mCTUT.onCallHoldReceived(call);
} catch (Exception ex) {
ex.printStackTrace();
Assert.fail("unexpected exception thrown" + ex.getMessage());
}
verify(mImsPhone, times(1)).startOnHoldTone(nullable(Connection.class));
}
Aggregations