use of android.telephony.ims.ImsStreamMediaProfile 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.ImsStreamMediaProfile in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp(getClass().getSimpleName());
replaceInstance(ImsPhoneCallTracker.class, "mPhone", mImsCT, mImsPhone);
mImsCallUT = new ImsPhoneCall(mImsCT, ImsPhoneCall.CONTEXT_FOREGROUND);
when(mImsCT.getPhone()).thenReturn(mImsPhone);
mMediaProfile = new ImsStreamMediaProfile();
}
Aggregations