FileDocCategorySizeDatePackage
ImsConfig.javaAPI DocAndroid 5.1 API15507Thu Mar 12 22:22:52 GMT 2015com.android.ims

ImsConfig

public class ImsConfig extends Object
Provides APIs to get/set the IMS service feature/capability/parameters. The config items include: 1) Items provisioned by the operator. 2) Items configured by user. Mainly service feature class.
hide

Fields Summary
private static final String
TAG
private boolean
DBG
private final com.android.ims.internal.IImsConfig
miConfig
private android.content.Context
mContext
private static final String
MODIFY_PHONE_STATE
Constructors Summary
public ImsConfig(com.android.ims.internal.IImsConfig iconfig, android.content.Context context)

    

         
        if (DBG) Rlog.d(TAG, "ImsConfig creates");
        miConfig = iconfig;
        mContext = context;
    
Methods Summary
public voidgetFeatureValue(int feature, int network, com.android.ims.ImsConfigListener listener)
Gets the value for IMS feature item for specified network type.

param
feature, defined as in FeatureConstants.
param
network, defined as in android.telephony.TelephonyManager#NETWORK_TYPE_XXX.
param
listener, provided to be notified for the feature on/off status.
return
void
throws
ImsException if calling the IMS service results in an error.

        if (DBG) {
            Rlog.d(TAG, "getFeatureValue: feature = " + feature + ", network =" + network +
                    ", listener =" + listener);
        }
        try {
            miConfig.getFeatureValue(feature, network, listener);
        } catch (RemoteException e) {
            throw new ImsException("getFeatureValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
    
public java.lang.StringgetProvisionedStringValue(int item)
Gets the provisioned value for IMS service/capabilities parameters used by IMS stack. This function should not be called from the mainthread as it could block the mainthread.

param
item, as defined in com.android.ims.ImsConfig#ConfigConstants.
return
value in String format.
throws
ImsException if calling the IMS service results in an error.

        String ret = "Unknown";
        try {
            ret = miConfig.getProvisionedStringValue(item);
        }  catch (RemoteException e) {
            throw new ImsException("getProvisionedStringValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
        if (DBG) Rlog.d(TAG, "getProvisionedStringValue(): item = " + item + ", ret =" + ret);

        return ret;
    
public intgetProvisionedValue(int item)
Gets the provisioned value for IMS service/capabilities parameters used by IMS stack. This function should not be called from the mainthread as it could block the mainthread.

param
item, as defined in com.android.ims.ImsConfig#ConfigConstants.
return
the value in Integer format.
throws
ImsException if calling the IMS service results in an error.

        int ret = 0;
        try {
            ret = miConfig.getProvisionedValue(item);
        }  catch (RemoteException e) {
            throw new ImsException("getValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
        if (DBG) Rlog.d(TAG, "getProvisionedValue(): item = " + item + ", ret =" + ret);

        return ret;
    
public booleangetVolteProvisioned()
Gets the value for IMS Volte provisioned. It should be the same as operator provisioned value if applies.

return
boolean
throws
ImsException if calling the IMS service results in an error.

        try {
           return miConfig.getVolteProvisioned();
        } catch (RemoteException e) {
            throw new ImsException("getVolteProvisioned()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
    
public voidsetFeatureValue(int feature, int network, int value, com.android.ims.ImsConfigListener listener)
Sets the value for IMS feature item for specified network type.

param
feature, as defined in FeatureConstants.
param
network, as defined in android.telephony.TelephonyManager#NETWORK_TYPE_XXX.
param
value, as defined in FeatureValueConstants.
param
listener, provided if caller needs to be notified for set result.
return
void
throws
ImsException if calling the IMS service results in an error.

        mContext.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
        if (DBG) {
            Rlog.d(TAG, "setFeatureValue: feature = " + feature + ", network =" + network +
                    ", value =" + value + ", listener =" + listener);
        }
        try {
            miConfig.setFeatureValue(feature, network, value, listener);
        } catch (RemoteException e) {
            throw new ImsException("setFeatureValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
    
public intsetProvisionedStringValue(int item, java.lang.String value)
Sets the value for IMS service/capabilities parameters by the operator device management entity. This function should not be called from main thread as it could block mainthread.

param
item, as defined in com.android.ims.ImsConfig#ConfigConstants.
param
value in String format.
return
as defined in com.android.ims.ImsConfig#OperationStatusConstants
throws
ImsException if calling the IMS service results in an error.

        mContext.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
        int ret = ImsConfig.OperationStatusConstants.UNKNOWN;
        try {
            ret = miConfig.setProvisionedStringValue(item, value);
        }  catch (RemoteException e) {
            throw new ImsException("setProvisionedStringValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
        if (DBG) {
            Rlog.d(TAG, "setProvisionedStringValue(): item = " + item +
                    ", value =" + value);
        }
        return ret;
    
public intsetProvisionedValue(int item, int value)
Sets the value for IMS service/capabilities parameters by the operator device management entity. This function should not be called from main thread as it could block mainthread.

param
item, as defined in com.android.ims.ImsConfig#ConfigConstants.
param
value in Integer format.
return
as defined in com.android.ims.ImsConfig#OperationStatusConstants
throws
ImsException if calling the IMS service results in an error.

        mContext.enforceCallingOrSelfPermission(MODIFY_PHONE_STATE, null);
        int ret = ImsConfig.OperationStatusConstants.UNKNOWN;
        if (DBG) {
            Rlog.d(TAG, "setProvisionedValue(): item = " + item +
                    "value = " + value);
        }
        try {
            ret = miConfig.setProvisionedValue(item, value);
        }  catch (RemoteException e) {
            throw new ImsException("setProvisionedValue()", e,
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
        if (DBG) {
            Rlog.d(TAG, "setProvisionedValue(): item = " + item +
                    " value = " + value + " ret = " + ret);
        }
        return ret;