use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyTester method handleTestConferenceEventPackage.
/**
* Handles request to send a test conference event package to the active Ims call.
*
* @see com.android.internal.telephony.test.TestConferenceEventPackageParser
* @param context The context.
* @param fileName The name of the test conference event package file to read.
*/
private void handleTestConferenceEventPackage(Context context, String fileName, boolean isBypassingImsCall) {
// Attempt to get the active IMS call before parsing the test XML file.
ImsPhone imsPhone = (ImsPhone) mPhone;
if (imsPhone == null) {
return;
}
ImsPhoneCallTracker tracker = (ImsPhoneCallTracker) imsPhone.getCallTracker();
File packageFile = new File(context.getFilesDir(), fileName);
final FileInputStream is;
try {
is = new FileInputStream(packageFile);
} catch (FileNotFoundException ex) {
log("Test conference event package file not found: " + packageFile.getAbsolutePath());
return;
}
TestConferenceEventPackageParser parser = new TestConferenceEventPackageParser(is);
ImsConferenceState imsConferenceState = parser.parse();
if (imsConferenceState == null) {
return;
}
if (isBypassingImsCall) {
tracker.injectTestConferenceState(imsConferenceState);
} else {
ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall();
if (imsPhoneCall == null) {
return;
}
ImsCall imsCall = imsPhoneCall.getImsCall();
if (imsCall == null) {
return;
}
imsCall.conferenceStateUpdated(imsConferenceState);
}
}
use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyTester method handleHandoverFailedIntent.
private void handleHandoverFailedIntent() {
// Attempt to get the active IMS call
ImsPhone imsPhone = (ImsPhone) mPhone;
if (imsPhone == null) {
return;
}
ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall();
if (imsPhoneCall == null) {
return;
}
ImsCall imsCall = imsPhoneCall.getImsCall();
if (imsCall == null) {
return;
}
imsCall.getImsCallSessionListenerProxy().callSessionHandoverFailed(imsCall.getCallSession(), TelephonyManager.NETWORK_TYPE_LTE, TelephonyManager.NETWORK_TYPE_IWLAN, new ImsReasonInfo());
}
use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyTester method testImsECall.
void testImsECall() {
// Attempt to get the active IMS call before parsing the test XML file.
ImsPhone imsPhone = (ImsPhone) mPhone;
if (imsPhone == null) {
return;
}
ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall();
if (imsPhoneCall == null) {
return;
}
ImsCall imsCall = imsPhoneCall.getImsCall();
if (imsCall == null) {
return;
}
ImsCallProfile callProfile = imsCall.getCallProfile();
Bundle extras = callProfile.getCallExtras();
if (extras == null) {
extras = new Bundle();
}
extras.putBoolean(ImsCallProfile.EXTRA_EMERGENCY_CALL, true);
callProfile.mCallExtras = extras;
imsCall.getImsCallSessionListenerProxy().callSessionUpdated(imsCall.getSession(), callProfile);
}
Aggregations