Search in sources :

Example 16 with ImsException

use of com.android.ims.ImsException in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhone method getCommandException.

private CommandException getCommandException(Throwable e) {
    CommandException ex = null;
    if (e instanceof ImsException) {
        ex = getCommandException(((ImsException) e).getCode(), e.getMessage());
    } else {
        Rlog.d(LOG_TAG, "getCommandException generic failure");
        ex = new CommandException(CommandException.Error.GENERIC_FAILURE);
    }
    return ex;
}
Also used : ImsException(com.android.ims.ImsException) CommandException(com.android.internal.telephony.CommandException)

Example 17 with ImsException

use of com.android.ims.ImsException in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhone method setCallWaiting.

public void setCallWaiting(boolean enable, int serviceClass, Message onComplete) {
    if (DBG)
        Rlog.d(LOG_TAG, "setCallWaiting enable=" + enable);
    Message resp;
    resp = obtainMessage(EVENT_SET_CALL_WAITING_DONE, onComplete);
    try {
        ImsUtInterface ut = mCT.getUtInterface();
        ut.updateCallWaiting(enable, serviceClass, resp);
    } catch (ImsException e) {
        sendErrorResponse(onComplete, e);
    }
}
Also used : Message(android.os.Message) ImsUtInterface(com.android.ims.ImsUtInterface) ImsException(com.android.ims.ImsException)

Example 18 with ImsException

use of com.android.ims.ImsException in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhone method getOutgoingCallerIdDisplay.

@Override
public void getOutgoingCallerIdDisplay(Message onComplete) {
    if (DBG)
        Rlog.d(LOG_TAG, "getCLIR");
    Message resp;
    resp = obtainMessage(EVENT_GET_CLIR_DONE, onComplete);
    try {
        ImsUtInterface ut = mCT.getUtInterface();
        ut.queryCLIR(resp);
    } catch (ImsException e) {
        sendErrorResponse(onComplete, e);
    }
}
Also used : Message(android.os.Message) ImsUtInterface(com.android.ims.ImsUtInterface) ImsException(com.android.ims.ImsException)

Example 19 with ImsException

use of com.android.ims.ImsException in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhone method setCallForwardingOption.

public void setCallForwardingOption(int commandInterfaceCFAction, int commandInterfaceCFReason, String dialingNumber, int serviceClass, int timerSeconds, Message onComplete) {
    if (DBG)
        Rlog.d(LOG_TAG, "setCallForwardingOption action=" + commandInterfaceCFAction + ", reason=" + commandInterfaceCFReason + " serviceClass=" + serviceClass);
    if ((isValidCommandInterfaceCFAction(commandInterfaceCFAction)) && (isValidCommandInterfaceCFReason(commandInterfaceCFReason))) {
        Message resp;
        Cf cf = new Cf(dialingNumber, (commandInterfaceCFReason == CF_REASON_UNCONDITIONAL ? true : false), onComplete);
        resp = obtainMessage(EVENT_SET_CALL_FORWARD_DONE, isCfEnable(commandInterfaceCFAction) ? 1 : 0, 0, cf);
        try {
            ImsUtInterface ut = mCT.getUtInterface();
            ut.updateCallForward(getActionFromCFAction(commandInterfaceCFAction), getConditionFromCFReason(commandInterfaceCFReason), dialingNumber, serviceClass, timerSeconds, resp);
        } catch (ImsException e) {
            sendErrorResponse(onComplete, e);
        }
    } else if (onComplete != null) {
        sendErrorResponse(onComplete);
    }
}
Also used : Message(android.os.Message) ImsUtInterface(com.android.ims.ImsUtInterface) ImsException(com.android.ims.ImsException)

Example 20 with ImsException

use of com.android.ims.ImsException in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiCallingSettingsForSub method onResume.

@Override
public void onResume() {
    super.onResume();
    final Context context = getActivity();
    updateBody();
    if (mImsManager.isWfcEnabledByPlatform()) {
        mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
        mSwitchBar.addOnSwitchChangeListener(this);
        mValidListener = true;
    }
    context.registerReceiver(mIntentReceiver, mIntentFilter);
    Intent intent = getActivity().getIntent();
    if (intent.getBooleanExtra(Phone.EXTRA_KEY_ALERT_SHOW, false)) {
        showAlert(intent);
    }
    // Register callback for provisioning changes.
    try {
        mImsManager.getConfigInterface().addConfigCallback(mProvisioningCallback);
    } catch (ImsException e) {
        Log.w(TAG, "onResume: Unable to register callback for provisioning changes.");
    }
}
Also used : Context(android.content.Context) ImsException(com.android.ims.ImsException) Intent(android.content.Intent)

Aggregations

ImsException (com.android.ims.ImsException)37 Message (android.os.Message)9 ImsUtInterface (com.android.ims.ImsUtInterface)8 ImsCall (com.android.ims.ImsCall)7 ImsConfig (com.android.ims.ImsConfig)7 SpannableStringBuilder (android.text.SpannableStringBuilder)6 CallStateException (com.android.internal.telephony.CallStateException)6 ImsCallProfile (com.android.ims.ImsCallProfile)4 Context (android.content.Context)3 PendingIntent (android.app.PendingIntent)2 Bundle (android.os.Bundle)2 FlakyTest (android.support.test.filters.FlakyTest)2 SmallTest (android.test.suitebuilder.annotation.SmallTest)2 ImsConnectionStateListener (com.android.ims.ImsConnectionStateListener)2 ImsSsInfo (com.android.ims.ImsSsInfo)2 CommandException (com.android.internal.telephony.CommandException)2 TelephonyTest (com.android.internal.telephony.TelephonyTest)2 Test (org.junit.Test)2 Intent (android.content.Intent)1 AsyncResult (android.os.AsyncResult)1