Search in sources :

Example 1 with ImsPhone

use of com.android.internal.telephony.imsphone.ImsPhone in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyTester method handleTestDialogEventPackageIntent.

/**
 * Handles intents containing test dialog event package data.
 *
 * @param intent
 */
private void handleTestDialogEventPackageIntent(Intent intent) {
    ImsPhone imsPhone = (ImsPhone) mPhone;
    if (imsPhone == null) {
        return;
    }
    ImsExternalCallTracker externalCallTracker = imsPhone.getExternalCallTracker();
    if (externalCallTracker == null) {
        return;
    }
    if (intent.hasExtra(EXTRA_STARTPACKAGE)) {
        mImsExternalCallStates.clear();
    } else if (intent.hasExtra(EXTRA_SENDPACKAGE)) {
        externalCallTracker.refreshExternalCallState(mImsExternalCallStates);
        mImsExternalCallStates.clear();
    } else if (intent.hasExtra(EXTRA_DIALOGID)) {
        ImsExternalCallState state = new ImsExternalCallState(intent.getIntExtra(EXTRA_DIALOGID, 0), Uri.parse(intent.getStringExtra(EXTRA_NUMBER)), intent.getBooleanExtra(EXTRA_CANPULL, true), intent.getIntExtra(EXTRA_STATE, ImsExternalCallState.CALL_STATE_CONFIRMED), ImsCallProfile.CALL_TYPE_VOICE, false);
        mImsExternalCallStates.add(state);
    }
}
Also used : ImsExternalCallTracker(com.android.internal.telephony.imsphone.ImsExternalCallTracker) ImsExternalCallState(com.android.ims.ImsExternalCallState) ImsPhone(com.android.internal.telephony.imsphone.ImsPhone)

Example 2 with ImsPhone

use of com.android.internal.telephony.imsphone.ImsPhone in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyTester method sendTestSuppServiceNotification.

private void sendTestSuppServiceNotification(Intent intent) {
    if (intent.hasExtra(EXTRA_CODE)) {
        int code = intent.getIntExtra(EXTRA_CODE, -1);
        ImsPhone imsPhone = (ImsPhone) mPhone;
        if (imsPhone == null) {
            return;
        }
        log("Test supp service notification:" + code);
        SuppServiceNotification suppServiceNotification = new SuppServiceNotification();
        suppServiceNotification.code = code;
        imsPhone.notifySuppSvcNotification(suppServiceNotification);
    }
}
Also used : SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) ImsPhone(com.android.internal.telephony.imsphone.ImsPhone)

Example 3 with ImsPhone

use of com.android.internal.telephony.imsphone.ImsPhone 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)

Example 4 with ImsPhone

use of com.android.internal.telephony.imsphone.ImsPhone in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyTester method handleSuppServiceFailedIntent.

private void handleSuppServiceFailedIntent(Intent intent) {
    ImsPhone imsPhone = (ImsPhone) mPhone;
    if (imsPhone == null) {
        return;
    }
    int code = intent.getIntExtra(EXTRA_FAILURE_CODE, 0);
    imsPhone.notifySuppServiceFailed(PhoneInternalInterface.SuppService.values()[code]);
}
Also used : ImsPhone(com.android.internal.telephony.imsphone.ImsPhone)

Example 5 with ImsPhone

use of com.android.internal.telephony.imsphone.ImsPhone 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(), ServiceState.RIL_RADIO_TECHNOLOGY_LTE, ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN, new ImsReasonInfo());
}
Also used : ImsCall(com.android.ims.ImsCall) ImsPhoneCall(com.android.internal.telephony.imsphone.ImsPhoneCall) ImsPhone(com.android.internal.telephony.imsphone.ImsPhone) ImsReasonInfo(com.android.ims.ImsReasonInfo)

Aggregations

ImsPhone (com.android.internal.telephony.imsphone.ImsPhone)5 ImsCall (com.android.ims.ImsCall)2 ImsPhoneCall (com.android.internal.telephony.imsphone.ImsPhoneCall)2 ImsConferenceState (com.android.ims.ImsConferenceState)1 ImsExternalCallState (com.android.ims.ImsExternalCallState)1 ImsReasonInfo (com.android.ims.ImsReasonInfo)1 SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)1 ImsExternalCallTracker (com.android.internal.telephony.imsphone.ImsExternalCallTracker)1 TestConferenceEventPackageParser (com.android.internal.telephony.test.TestConferenceEventPackageParser)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1