Search in sources :

Example 1 with GsmBroadcastSmsConfigInfo

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

the class RIL method setGsmBroadcastConfig.

@Override
public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GSM_SET_BROADCAST_CONFIG, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + config.length + " configs : ");
            for (int i = 0; i < config.length; i++) {
                riljLog(config[i].toString());
            }
        }
        ArrayList<GsmBroadcastSmsConfigInfo> configs = new ArrayList<>();
        int numOfConfig = config.length;
        GsmBroadcastSmsConfigInfo info;
        for (int i = 0; i < numOfConfig; i++) {
            info = new GsmBroadcastSmsConfigInfo();
            info.fromServiceId = config[i].getFromServiceId();
            info.toServiceId = config[i].getToServiceId();
            info.fromCodeScheme = config[i].getFromCodeScheme();
            info.toCodeScheme = config[i].getToCodeScheme();
            info.selected = config[i].isSelected();
            configs.add(info);
        }
        try {
            radioProxy.setGsmBroadcastConfig(rr.mSerial, configs);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setGsmBroadcastConfig", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) ArrayList(java.util.ArrayList) GsmBroadcastSmsConfigInfo(android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo) RemoteException(android.os.RemoteException)

Aggregations

GsmBroadcastSmsConfigInfo (android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo)1 IRadio (android.hardware.radio.V1_0.IRadio)1 RemoteException (android.os.RemoteException)1 ArrayList (java.util.ArrayList)1