use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTrackerTest method testRemoteToneInactive.
/**
* Verifies that a remote hold tone is played when the call is remotely held and the media
* direction is inactive (i.e. the audio stream is not playing, so we should play the tone).
*/
@Test
@SmallTest
public void testRemoteToneInactive() {
// establish a MT call
testImsMTCallAccept();
ImsPhoneConnection connection = mCTUT.mForegroundCall.getFirstConnection();
ImsCall call = connection.getImsCall();
// Set the media direction to inactive to trigger a hold tone.
ImsCallProfile callProfile = new ImsCallProfile();
callProfile.mMediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_INACTIVE;
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));
}
use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTrackerTest method testMergeComplete.
@Test
@SmallTest
public void testMergeComplete() {
boolean[] result = new boolean[1];
// Place a call.
ImsPhoneConnection connection = placeCallAndMakeActive();
connection.addListener(new Connection.ListenerBase() {
@Override
public void onConnectionEvent(String event, Bundle extras) {
result[0] = android.telecom.Connection.EVENT_MERGE_COMPLETE.equals(event);
}
});
ImsCall call = connection.getImsCall();
call.getListener().onCallMerged(call, null, false);
assertTrue(result[0]);
}
use of com.android.ims.ImsCall 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 com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class ImsCallTest method testNullCallProfile.
@Test
@SmallTest
public void testNullCallProfile() {
ImsCall imsCall = new ImsCall(mContext, null);
assertNotNull(imsCall);
assertFalse(imsCall.wasVideoCall());
}
use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class ImsCallTest method testSetLteNoWifiDeprecated.
@Test
@SmallTest
public void testSetLteNoWifiDeprecated() {
ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
assertFalse(mTestImsCall.isWifiCall());
assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE, ServiceState.RIL_RADIO_TECHNOLOGY_LTE + "");
assertFalse(mTestImsCall.isWifiCall());
assertEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Aggregations