Search in sources :

Example 1 with CdmaBroadcastSmsConfigInfo

use of android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo in project android_frameworks_opt_telephony by LineageOS.

the class RIL method setCdmaBroadcastConfig.

@Override
public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, result, mRILDefaultWorkSource);
        ArrayList<CdmaBroadcastSmsConfigInfo> halConfigs = new ArrayList<>();
        for (CdmaSmsBroadcastConfigInfo config : configs) {
            for (int i = config.getFromServiceCategory(); i <= config.getToServiceCategory(); i++) {
                CdmaBroadcastSmsConfigInfo info = new CdmaBroadcastSmsConfigInfo();
                info.serviceCategory = i;
                info.language = config.getLanguage();
                info.selected = config.isSelected();
                halConfigs.add(info);
            }
        }
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + halConfigs.size() + " configs : ");
            for (CdmaBroadcastSmsConfigInfo config : halConfigs) {
                riljLog(config.toString());
            }
        }
        try {
            radioProxy.setCdmaBroadcastConfig(rr.mSerial, halConfigs);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setCdmaBroadcastConfig", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CdmaSmsBroadcastConfigInfo(com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo) ArrayList(java.util.ArrayList) RemoteException(android.os.RemoteException) CdmaBroadcastSmsConfigInfo(android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo)

Aggregations

CdmaBroadcastSmsConfigInfo (android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo)1 IRadio (android.hardware.radio.V1_0.IRadio)1 RemoteException (android.os.RemoteException)1 CdmaSmsBroadcastConfigInfo (com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo)1 ArrayList (java.util.ArrayList)1