Search in sources :

Example 1 with ImsConferenceState

use of com.android.ims.ImsConferenceState 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) {
    // 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;
    }
    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;
    }
    imsCall.conferenceStateUpdated(imsConferenceState);
}
Also used : TestConferenceEventPackageParser(com.android.internal.telephony.test.TestConferenceEventPackageParser) ImsCall(com.android.ims.ImsCall) ImsPhoneCall(com.android.internal.telephony.imsphone.ImsPhoneCall) FileNotFoundException(java.io.FileNotFoundException) ImsPhone(com.android.internal.telephony.imsphone.ImsPhone) File(java.io.File) FileInputStream(java.io.FileInputStream) ImsConferenceState(com.android.ims.ImsConferenceState)

Aggregations

ImsCall (com.android.ims.ImsCall)1 ImsConferenceState (com.android.ims.ImsConferenceState)1 ImsPhone (com.android.internal.telephony.imsphone.ImsPhone)1 ImsPhoneCall (com.android.internal.telephony.imsphone.ImsPhoneCall)1 TestConferenceEventPackageParser (com.android.internal.telephony.test.TestConferenceEventPackageParser)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1