[ofono-binder] Add support for Radio@1.6 interface. JB#63650
This commit is contained in:
		@@ -41,6 +41,7 @@ enum binder_cell_info_event {
 | 
			
		||||
    CELL_INFO_EVENT_1_2,
 | 
			
		||||
    CELL_INFO_EVENT_1_4,
 | 
			
		||||
    CELL_INFO_EVENT_1_5,
 | 
			
		||||
    CELL_INFO_EVENT_1_6,
 | 
			
		||||
    CELL_INFO_EVENT_COUNT
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -795,6 +796,49 @@ binder_cell_info_array_new_1_5(
 | 
			
		||||
    return l;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
GPtrArray*
 | 
			
		||||
binder_cell_info_array_new_1_6(
 | 
			
		||||
    const RadioCellInfo_1_6* cells,
 | 
			
		||||
    gsize count)
 | 
			
		||||
{
 | 
			
		||||
    gsize i;
 | 
			
		||||
    GPtrArray* l = g_ptr_array_sized_new(count + 1);
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < count; i++) {
 | 
			
		||||
        const RadioCellInfo_1_6* cell = cells + i;
 | 
			
		||||
        const gboolean registered = cell->registered;
 | 
			
		||||
 | 
			
		||||
        switch ((RADIO_CELL_INFO_TYPE_1_5)cell->cellInfoType) {
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_GSM:
 | 
			
		||||
            g_ptr_array_add(l, binder_cell_info_new_cell_gsm(registered,
 | 
			
		||||
                &cell->info.gsm.cellIdentityGsm.base.base,
 | 
			
		||||
                &cell->info.gsm.signalStrengthGsm));
 | 
			
		||||
            continue;
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_LTE:
 | 
			
		||||
            g_ptr_array_add(l, binder_cell_info_new_cell_lte(registered,
 | 
			
		||||
                &cell->info.lte.cellIdentityLte.base.base,
 | 
			
		||||
                &cell->info.lte.signalStrengthLte.base));
 | 
			
		||||
            continue;
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_WCDMA:
 | 
			
		||||
            g_ptr_array_add(l, binder_cell_info_new_cell_wcdma(registered,
 | 
			
		||||
                &cell->info.wcdma.cellIdentityWcdma.base.base,
 | 
			
		||||
                &cell->info.wcdma.signalStrengthWcdma.base));
 | 
			
		||||
            continue;
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_NR:
 | 
			
		||||
            g_ptr_array_add(l, binder_cell_info_new_cell_nr(registered,
 | 
			
		||||
                &cell->info.nr.cellIdentityNr.base,
 | 
			
		||||
                &cell->info.nr.signalStrengthNr.base));
 | 
			
		||||
            continue;
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_TD_SCDMA:
 | 
			
		||||
        case RADIO_CELL_INFO_1_5_CDMA:
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        DBG("unsupported cell type %d", cell->cellInfoType);
 | 
			
		||||
    }
 | 
			
		||||
    return l;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
GPtrArray*
 | 
			
		||||
binder_cell_info_array_new_aidl(
 | 
			
		||||
@@ -919,6 +963,24 @@ binder_cell_info_list_1_5(
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_cell_info_list_1_6(
 | 
			
		||||
    BinderCellInfo* self,
 | 
			
		||||
    GBinderReader* reader)
 | 
			
		||||
{
 | 
			
		||||
    gsize count;
 | 
			
		||||
    const RadioCellInfo_1_6* cells = gbinder_reader_read_hidl_type_vec(reader,
 | 
			
		||||
        RadioCellInfo_1_6, &count);
 | 
			
		||||
 | 
			
		||||
    if (cells) {
 | 
			
		||||
        binder_cell_info_update_cells(self,
 | 
			
		||||
            binder_cell_info_array_new_1_6(cells, count));
 | 
			
		||||
    } else {
 | 
			
		||||
        ofono_warn("Failed to parse cellInfoList_1_6 payload");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_cell_info_list_aidl(
 | 
			
		||||
@@ -1005,6 +1067,25 @@ binder_cell_info_list_changed_1_5(
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_cell_info_list_changed_1_6(
 | 
			
		||||
    RadioClient* client,
 | 
			
		||||
    RADIO_IND code,
 | 
			
		||||
    const GBinderReader* args,
 | 
			
		||||
    gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
    BinderCellInfo* self = THIS(user_data);
 | 
			
		||||
 | 
			
		||||
    GASSERT(code == RADIO_IND_CELL_INFO_LIST_1_6);
 | 
			
		||||
    if (self->enabled) {
 | 
			
		||||
        GBinderReader reader;
 | 
			
		||||
 | 
			
		||||
        gbinder_reader_copy(&reader, args);
 | 
			
		||||
        binder_cell_info_list_1_6(self, &reader);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_cell_info_list_changed_aidl(
 | 
			
		||||
@@ -1061,6 +1142,9 @@ binder_cell_info_list_cb(
 | 
			
		||||
                    case RADIO_RESP_GET_CELL_INFO_LIST_1_5:
 | 
			
		||||
                        binder_cell_info_list_1_5(self, &reader);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case RADIO_RESP_GET_CELL_INFO_LIST_1_6:
 | 
			
		||||
                        binder_cell_info_list_1_6(self, &reader);
 | 
			
		||||
                        break;
 | 
			
		||||
                    default:
 | 
			
		||||
                        ofono_warn("Unexpected getCellInfoList response %d", resp);
 | 
			
		||||
                        break;
 | 
			
		||||
@@ -1136,6 +1220,8 @@ binder_cell_info_query(
 | 
			
		||||
    const RADIO_AIDL_INTERFACE iface_aidl = radio_client_aidl_interface(self->client);
 | 
			
		||||
    guint32 code = iface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
        RADIO_NETWORK_REQ_GET_CELL_INFO_LIST :
 | 
			
		||||
        radio_client_interface(self->client) >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
           RADIO_REQ_GET_CELL_INFO_LIST_1_6 :
 | 
			
		||||
           RADIO_REQ_GET_CELL_INFO_LIST;
 | 
			
		||||
 | 
			
		||||
    radio_request_drop(self->query_req);
 | 
			
		||||
@@ -1364,6 +1450,10 @@ binder_cell_info_new(
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
                RADIO_IND_CELL_INFO_LIST_1_5,
 | 
			
		||||
                binder_cell_info_list_changed_1_5, self);
 | 
			
		||||
        self->event_id[CELL_INFO_EVENT_1_6] =
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
                RADIO_IND_CELL_INFO_LIST_1_6,
 | 
			
		||||
                binder_cell_info_list_changed_1_6, self);
 | 
			
		||||
    } else {
 | 
			
		||||
        self->event_id[CELL_INFO_EVENT_1_0] =
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
 
 | 
			
		||||
@@ -85,6 +85,7 @@ enum binder_data_io_event_id {
 | 
			
		||||
    IO_EVENT_DATA_CALL_LIST_CHANGED_1_0,
 | 
			
		||||
    IO_EVENT_DATA_CALL_LIST_CHANGED_1_4,
 | 
			
		||||
    IO_EVENT_DATA_CALL_LIST_CHANGED_1_5,
 | 
			
		||||
    IO_EVENT_DATA_CALL_LIST_CHANGED_1_6,
 | 
			
		||||
    IO_EVENT_DEATH,
 | 
			
		||||
    IO_EVENT_COUNT
 | 
			
		||||
};
 | 
			
		||||
@@ -592,6 +593,36 @@ binder_data_call_new_1_5(
 | 
			
		||||
    return call;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
BinderDataCall*
 | 
			
		||||
binder_data_call_new_1_6(
 | 
			
		||||
    const RadioDataCall_1_6* dc)
 | 
			
		||||
{
 | 
			
		||||
    BinderDataCall* call = binder_data_call_new();
 | 
			
		||||
 | 
			
		||||
    call->cid = dc->cid;
 | 
			
		||||
    call->status = dc->cause;
 | 
			
		||||
    call->active = dc->active;
 | 
			
		||||
    call->prot = dc->type;
 | 
			
		||||
    call->retry_time = dc->suggestedRetryTime;
 | 
			
		||||
    call->mtu = dc->mtuV4;
 | 
			
		||||
    call->ifname = g_strdup(dc->ifname.data.str);
 | 
			
		||||
    call->dnses = binder_strv_from_hidl_string_vec(&dc->dnses);
 | 
			
		||||
    call->gateways = binder_strv_from_hidl_string_vec(&dc->gateways);
 | 
			
		||||
    call->addresses = binder_strv_from_hidl_string_vec(&dc->addresses);
 | 
			
		||||
    call->pcscf = binder_strv_from_hidl_string_vec(&dc->pcscf);
 | 
			
		||||
 | 
			
		||||
    DBG("[status=%d,retry=%d,cid=%d,active=%d,type=%d,ifname=%s,"
 | 
			
		||||
        "mtu=%d,address=%s,dns=%s,gateways=%s,pcscf=%s]",
 | 
			
		||||
        call->status, call->retry_time, call->cid, call->active,
 | 
			
		||||
        dc->type, call->ifname, call->mtu,
 | 
			
		||||
        binder_print_strv(call->addresses, " "),
 | 
			
		||||
        binder_print_strv(call->dnses, " "),
 | 
			
		||||
        binder_print_strv(call->gateways, " "),
 | 
			
		||||
        binder_print_strv(call->pcscf, " "));
 | 
			
		||||
    return call;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
BinderDataCall*
 | 
			
		||||
binder_data_call_new_aidl(
 | 
			
		||||
@@ -722,6 +753,28 @@ binder_data_call_list_1_5(
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
GSList*
 | 
			
		||||
binder_data_call_list_1_6(
 | 
			
		||||
    const RadioDataCall_1_6* calls,
 | 
			
		||||
    gsize n)
 | 
			
		||||
{
 | 
			
		||||
    if (n) {
 | 
			
		||||
        gsize i;
 | 
			
		||||
        GSList* l = NULL;
 | 
			
		||||
 | 
			
		||||
        DBG("num=%u", (guint) n);
 | 
			
		||||
        for (i = 0; i < n; i++) {
 | 
			
		||||
            l = g_slist_insert_sorted(l, binder_data_call_new_1_6(calls + i),
 | 
			
		||||
                binder_data_call_compare);
 | 
			
		||||
        }
 | 
			
		||||
        return l;
 | 
			
		||||
    } else {
 | 
			
		||||
        DBG("no data calls");
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
GSList*
 | 
			
		||||
binder_data_call_list_aidl(
 | 
			
		||||
@@ -997,6 +1050,26 @@ binder_data_call_list_changed_1_5(
 | 
			
		||||
    binder_data_call_list_changed(data, binder_data_call_list_1_5(calls, n));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_data_call_list_changed_1_6(
 | 
			
		||||
    RadioClient* client,
 | 
			
		||||
    RADIO_IND code,
 | 
			
		||||
    const GBinderReader* args,
 | 
			
		||||
    gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
    BinderDataObject* data = THIS(user_data);
 | 
			
		||||
    GBinderReader reader;
 | 
			
		||||
    const RadioDataCall_1_6* calls;
 | 
			
		||||
    gsize n = 0;
 | 
			
		||||
 | 
			
		||||
    /* dataCallListChanged_1_6(RadioIndicationType,vec<SetupDataCallResult>) */
 | 
			
		||||
    GASSERT(code == RADIO_IND_DATA_CALL_LIST_CHANGED_1_6);
 | 
			
		||||
    gbinder_reader_copy(&reader, args);
 | 
			
		||||
    calls = gbinder_reader_read_hidl_type_vec(&reader, RadioDataCall_1_6, &n);
 | 
			
		||||
    binder_data_call_list_changed(data, binder_data_call_list_1_6(calls, n));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_data_call_list_changed_aidl(
 | 
			
		||||
@@ -1074,6 +1147,16 @@ void binder_data_query_data_calls_cb(
 | 
			
		||||
                            RadioDataCall_1_5, &count);
 | 
			
		||||
 | 
			
		||||
                    list = binder_data_call_list_1_5(calls, count);
 | 
			
		||||
                } else if (resp == RADIO_RESP_GET_DATA_CALL_LIST_1_6) {
 | 
			
		||||
                    /*
 | 
			
		||||
                     * getDataCallListResponse_1_6(RadioResponseInfo,
 | 
			
		||||
                     *     vec<SetupDataCallResult> dcResponse);
 | 
			
		||||
                     */
 | 
			
		||||
                    const RadioDataCall_1_6* calls =
 | 
			
		||||
                        gbinder_reader_read_hidl_type_vec(&reader,
 | 
			
		||||
                            RadioDataCall_1_6, &count);
 | 
			
		||||
 | 
			
		||||
                    list = binder_data_call_list_1_6(calls, count);
 | 
			
		||||
                } else {
 | 
			
		||||
                    ofono_error("Unexpected getDataCallList response %d", resp);
 | 
			
		||||
                }
 | 
			
		||||
@@ -1420,6 +1503,17 @@ binder_data_call_setup_cb(
 | 
			
		||||
                    if (dc) {
 | 
			
		||||
                        call = binder_data_call_new_1_5(dc);
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (resp == RADIO_RESP_SETUP_DATA_CALL_1_6) {
 | 
			
		||||
                    /*
 | 
			
		||||
                     * setupDataCallResponse_1_6(RadioResponseInfo,
 | 
			
		||||
                     *     SetupDataCallResult dcResponse);
 | 
			
		||||
                     */
 | 
			
		||||
                    const RadioDataCall_1_6* dc =
 | 
			
		||||
                        gbinder_reader_read_hidl_struct(&reader, RadioDataCall_1_6);
 | 
			
		||||
 | 
			
		||||
                    if (dc) {
 | 
			
		||||
                        call = binder_data_call_new_1_6(dc);
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    ofono_error("Unexpected setupDataCall response %d", resp);
 | 
			
		||||
                }
 | 
			
		||||
@@ -1519,14 +1613,59 @@ binder_data_call_setup_submit(
 | 
			
		||||
        RADIO_APN_AUTH_NONE;
 | 
			
		||||
 | 
			
		||||
    if (data->interface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
        if (iface >= RADIO_INTERFACE_1_5) {
 | 
			
		||||
        if (iface >= RADIO_INTERFACE_1_6) {
 | 
			
		||||
            RadioDataProfile_1_5* dp;
 | 
			
		||||
            RadioOptionalSliceInfo sliceInfo;
 | 
			
		||||
            RadioOptionalTrafficDescriptor trafficDescriptor;
 | 
			
		||||
            sliceInfo.available = 0;
 | 
			
		||||
            trafficDescriptor.available = 0;
 | 
			
		||||
 | 
			
		||||
            req = radio_request_new2(g, RADIO_REQ_SETUP_DATA_CALL_1_6,
 | 
			
		||||
                &writer, binder_data_call_setup_cb, NULL, setup);
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork,
 | 
			
		||||
             * DataProfileInfo dataProfileInfo, bool roamingAllowed,
 | 
			
		||||
             * DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses,
 | 
			
		||||
             * int32_t pduSessionId, OptionalSliceInfo sliceInfo,
 | 
			
		||||
             * OptionalTrafficDescriptor trafficDescriptor, bool matchAllRuleAllowed);
 | 
			
		||||
             */
 | 
			
		||||
            dp = gbinder_writer_new0(&writer, RadioDataProfile_1_5);
 | 
			
		||||
            // profile id is only meaningful when it's persistent on the modem.
 | 
			
		||||
            // dp->profileId = setup->profile_id;
 | 
			
		||||
            dp->profileId = RADIO_DATA_PROFILE_INVALID;
 | 
			
		||||
            binder_copy_hidl_string(&writer, &dp->apn, setup->apn);
 | 
			
		||||
            dp->protocol = dp->roamingProtocol =
 | 
			
		||||
                binder_proto_from_ofono_proto(setup->proto);
 | 
			
		||||
            dp->authType = auth;
 | 
			
		||||
            binder_copy_hidl_string(&writer, &dp->user, setup->username);
 | 
			
		||||
            binder_copy_hidl_string(&writer, &dp->password, setup->password);
 | 
			
		||||
            dp->enabled = TRUE;
 | 
			
		||||
            dp->supportedApnTypesBitmap =
 | 
			
		||||
                binder_radio_apn_types_for_profile(setup->profile_id,
 | 
			
		||||
                    &data->profile_config);
 | 
			
		||||
 | 
			
		||||
            gbinder_writer_append_int32(&writer,
 | 
			
		||||
                binder_radio_access_network_for_tech(tech)); /* accessNetwork */
 | 
			
		||||
            gbinder_writer_append_struct(&writer, dp,
 | 
			
		||||
                &binder_data_profile_1_5_type, NULL);   /* dataProfileInfo */
 | 
			
		||||
            gbinder_writer_append_bool(&writer, TRUE);  /* roamingAllowed */
 | 
			
		||||
            gbinder_writer_append_int32(&writer,
 | 
			
		||||
                RADIO_DATA_REQUEST_REASON_NORMAL);      /* reason */
 | 
			
		||||
            gbinder_writer_append_hidl_string_vec(&writer, ¬hing, -1);
 | 
			
		||||
            gbinder_writer_append_hidl_string_vec(&writer, ¬hing, -1);
 | 
			
		||||
            gbinder_writer_append_int32(&writer, 0);    /* pduSessionId */
 | 
			
		||||
            gbinder_writer_append_buffer_object(&writer, &sliceInfo, sizeof(sliceInfo));
 | 
			
		||||
            gbinder_writer_append_buffer_object(&writer, &trafficDescriptor, sizeof(trafficDescriptor));
 | 
			
		||||
            gbinder_writer_append_bool(&writer, TRUE);  /* matchAllRuleAllowed */
 | 
			
		||||
        } else if (iface >= RADIO_INTERFACE_1_5) {
 | 
			
		||||
            RadioDataProfile_1_5* dp;
 | 
			
		||||
 | 
			
		||||
            req = radio_request_new2(g, RADIO_REQ_SETUP_DATA_CALL_1_5,
 | 
			
		||||
                &writer, binder_data_call_setup_cb, NULL, setup);
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * setupDataCall_1_4(int32_t serial, AccessNetwork accessNetwork,
 | 
			
		||||
             * setupDataCall_1_5(int32_t serial, AccessNetwork accessNetwork,
 | 
			
		||||
             *   DataProfileInfo dataProfileInfo, bool roamingAllowed,
 | 
			
		||||
             *   DataRequestReason reason, vec<string> addresses,
 | 
			
		||||
             *   vec<string> dnses);
 | 
			
		||||
@@ -1595,7 +1734,9 @@ binder_data_call_setup_submit(
 | 
			
		||||
            RadioDataProfile* dp;
 | 
			
		||||
            const char* proto_str = binder_proto_str_from_ofono_proto(setup->proto);
 | 
			
		||||
 | 
			
		||||
            req = radio_request_new2(g, (iface >= RADIO_INTERFACE_1_2) ?
 | 
			
		||||
            req = radio_request_new2(g, (iface >= RADIO_INTERFACE_1_6) ?
 | 
			
		||||
                RADIO_REQ_SETUP_DATA_CALL_1_6 :
 | 
			
		||||
                (iface >= RADIO_INTERFACE_1_2) ?
 | 
			
		||||
                    RADIO_REQ_SETUP_DATA_CALL_1_2 : RADIO_REQ_SETUP_DATA_CALL,
 | 
			
		||||
                &writer, binder_data_call_setup_cb, NULL, setup);
 | 
			
		||||
 | 
			
		||||
@@ -2244,6 +2385,10 @@ binder_data_new(
 | 
			
		||||
                radio_client_add_indication_handler(client,
 | 
			
		||||
                    RADIO_IND_DATA_CALL_LIST_CHANGED_1_5,
 | 
			
		||||
                    binder_data_call_list_changed_1_5, self);
 | 
			
		||||
            self->io_event_id[IO_EVENT_DATA_CALL_LIST_CHANGED_1_6] =
 | 
			
		||||
                radio_client_add_indication_handler(client,
 | 
			
		||||
                    RADIO_IND_DATA_CALL_LIST_CHANGED_1_6,
 | 
			
		||||
                    binder_data_call_list_changed_1_6, self);
 | 
			
		||||
            self->io_event_id[IO_EVENT_RESTRICTED_STATE_CHANGED] =
 | 
			
		||||
                radio_client_add_indication_handler(client,
 | 
			
		||||
                    RADIO_IND_RESTRICTED_STATE_CHANGED,
 | 
			
		||||
@@ -2309,6 +2454,8 @@ binder_data_poll_call_state(
 | 
			
		||||
    BinderDataObject* self = binder_data_cast(data);
 | 
			
		||||
    guint32 code = self->interface_aidl == RADIO_DATA_INTERFACE ?
 | 
			
		||||
        RADIO_DATA_REQ_GET_DATA_CALL_LIST :
 | 
			
		||||
        radio_client_interface(self->g->client) >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
            RADIO_REQ_GET_DATA_CALL_LIST_1_6 :
 | 
			
		||||
            RADIO_REQ_GET_DATA_CALL_LIST;
 | 
			
		||||
 | 
			
		||||
    if (G_LIKELY(self) && !self->query_req) {
 | 
			
		||||
 
 | 
			
		||||
@@ -51,9 +51,11 @@ enum binder_netreg_radio_ind {
 | 
			
		||||
    IND_SIGNAL_STRENGTH,
 | 
			
		||||
    IND_SIGNAL_STRENGTH_1_2,
 | 
			
		||||
    IND_SIGNAL_STRENGTH_1_4,
 | 
			
		||||
    IND_SIGNAL_STRENGTH_1_6,
 | 
			
		||||
    IND_NETWORK_SCAN_RESULT_1_2,
 | 
			
		||||
    IND_NETWORK_SCAN_RESULT_1_4,
 | 
			
		||||
    IND_NETWORK_SCAN_RESULT_1_5,
 | 
			
		||||
    IND_NETWORK_SCAN_RESULT_1_6,
 | 
			
		||||
    IND_MODEM_RESET,
 | 
			
		||||
    IND_COUNT
 | 
			
		||||
};
 | 
			
		||||
@@ -1320,6 +1322,38 @@ binder_netreg_scan_result_notify(
 | 
			
		||||
                    for (i = 0; i < n; i++) {
 | 
			
		||||
                        const RadioCellInfo_1_5* cell = cells + i;
 | 
			
		||||
 | 
			
		||||
                        switch ((RADIO_CELL_INFO_TYPE_1_5)cell->cellInfoType) {
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_GSM:
 | 
			
		||||
                            binder_netreg_scan_op_convert_gsm(cell->registered,
 | 
			
		||||
                                &cell->info.gsm.cellIdentityGsm.base,
 | 
			
		||||
                                binder_netreg_scan_op_append(scan));
 | 
			
		||||
                            break;
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_WCDMA:
 | 
			
		||||
                            binder_netreg_scan_op_convert_wcdma(cell->registered,
 | 
			
		||||
                                &cell->info.wcdma.cellIdentityWcdma.base,
 | 
			
		||||
                                binder_netreg_scan_op_append(scan));
 | 
			
		||||
                            break;
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_LTE:
 | 
			
		||||
                            binder_netreg_scan_op_convert_lte(cell->registered,
 | 
			
		||||
                                &cell->info.lte.cellIdentityLte.base,
 | 
			
		||||
                                binder_netreg_scan_op_append(scan));
 | 
			
		||||
                            break;
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_NR:
 | 
			
		||||
                            binder_netreg_scan_op_convert_nr(cell->registered,
 | 
			
		||||
                                &cell->info.nr.cellIdentityNr.base,
 | 
			
		||||
                                binder_netreg_scan_op_append(scan));
 | 
			
		||||
                            break;
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_CDMA:
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_TD_SCDMA:
 | 
			
		||||
                            break;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (code == RADIO_IND_NETWORK_SCAN_RESULT_1_6) {
 | 
			
		||||
                    const RadioCellInfo_1_6* cells = result->networkInfos.data.ptr;
 | 
			
		||||
 | 
			
		||||
                    for (i = 0; i < n; i++) {
 | 
			
		||||
                        const RadioCellInfo_1_6* cell = cells + i;
 | 
			
		||||
 | 
			
		||||
                        switch ((RADIO_CELL_INFO_TYPE_1_5)cell->cellInfoType) {
 | 
			
		||||
                        case RADIO_CELL_INFO_1_5_GSM:
 | 
			
		||||
                            binder_netreg_scan_op_convert_gsm(cell->registered,
 | 
			
		||||
@@ -1847,6 +1881,14 @@ binder_netreg_strength_notify(
 | 
			
		||||
                dbm = binder_netreg_get_signal_strength_dbm
 | 
			
		||||
                    (&ss->gsm, &ss->lte, &ss->wcdma, &ss->tdscdma, &ss->nr);
 | 
			
		||||
            }
 | 
			
		||||
        } else if (code == RADIO_IND_CURRENT_SIGNAL_STRENGTH_1_6) {
 | 
			
		||||
            const RadioSignalStrength_1_6* ss = gbinder_reader_read_hidl_struct
 | 
			
		||||
                (&reader, RadioSignalStrength_1_6);
 | 
			
		||||
 | 
			
		||||
            if (ss) {
 | 
			
		||||
                dbm = binder_netreg_get_signal_strength_dbm
 | 
			
		||||
                    (&ss->gsm, &ss->lte.base, &ss->wcdma, &ss->tdscdma, &ss->nr.base);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        dbm = binder_netreg_get_signal_strength_dbm_aidl(&reader);
 | 
			
		||||
@@ -2103,6 +2145,10 @@ binder_netreg_register(
 | 
			
		||||
            radio_client_add_indication_handler(self->client,
 | 
			
		||||
                RADIO_IND_CURRENT_SIGNAL_STRENGTH_1_4,
 | 
			
		||||
                binder_netreg_strength_notify, self);
 | 
			
		||||
        self->ind_id[IND_SIGNAL_STRENGTH_1_6] =
 | 
			
		||||
            radio_client_add_indication_handler(self->client,
 | 
			
		||||
                RADIO_IND_CURRENT_SIGNAL_STRENGTH_1_6,
 | 
			
		||||
                binder_netreg_strength_notify, self);
 | 
			
		||||
 | 
			
		||||
        /* Incremental scan results */
 | 
			
		||||
        self->ind_id[IND_NETWORK_SCAN_RESULT_1_2] =
 | 
			
		||||
@@ -2117,6 +2163,10 @@ binder_netreg_register(
 | 
			
		||||
            radio_client_add_indication_handler(self->client,
 | 
			
		||||
                RADIO_IND_NETWORK_SCAN_RESULT_1_5,
 | 
			
		||||
                binder_netreg_scan_result_notify, self);
 | 
			
		||||
        self->ind_id[IND_NETWORK_SCAN_RESULT_1_6] =
 | 
			
		||||
            radio_client_add_indication_handler(self->client,
 | 
			
		||||
                RADIO_IND_NETWORK_SCAN_RESULT_1_6,
 | 
			
		||||
                binder_netreg_scan_result_notify, self);
 | 
			
		||||
 | 
			
		||||
        /* Miscellaneous */
 | 
			
		||||
        self->ind_id[IND_MODEM_RESET] =
 | 
			
		||||
 
 | 
			
		||||
@@ -75,6 +75,7 @@ enum binder_network_ind_events {
 | 
			
		||||
    IND_NETWORK_STATE,
 | 
			
		||||
    IND_MODEM_RESET,
 | 
			
		||||
    IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_4,
 | 
			
		||||
    IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_6,
 | 
			
		||||
    IND_COUNT
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -658,6 +659,19 @@ binder_network_poll_voice_state_1_5(
 | 
			
		||||
        result->rat, l.lac, l.ci);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_network_poll_voice_state_1_6(
 | 
			
		||||
    BinderRegistrationState* state,
 | 
			
		||||
    const RadioRegStateResult_1_6* result)
 | 
			
		||||
{
 | 
			
		||||
    BinderNetworkLocation l;
 | 
			
		||||
 | 
			
		||||
    binder_network_location_1_5(&result->cellIdentity, &l);
 | 
			
		||||
    binder_network_set_registration_state(state, result->regState,
 | 
			
		||||
        result->rat, l.lac, l.ci);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_network_poll_voice_state_aidl(
 | 
			
		||||
@@ -736,6 +750,16 @@ binder_network_poll_voice_state_cb(
 | 
			
		||||
                        reason = result->reasonDataDenied;
 | 
			
		||||
                        binder_network_poll_voice_state_1_5(reg, result);
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (resp == RADIO_RESP_GET_VOICE_REGISTRATION_STATE_1_6) {
 | 
			
		||||
                    const RadioRegStateResult_1_6* result =
 | 
			
		||||
                        gbinder_reader_read_hidl_struct(&reader,
 | 
			
		||||
                            RadioRegStateResult_1_6);
 | 
			
		||||
 | 
			
		||||
                    if (result) {
 | 
			
		||||
                        reg = &state;
 | 
			
		||||
                        reason = result->reasonDataDenied;
 | 
			
		||||
                        binder_network_poll_voice_state_1_6(reg, result);
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    ofono_error("Unexpected getVoiceRegistrationState response %d",
 | 
			
		||||
                        resp);
 | 
			
		||||
@@ -850,6 +874,34 @@ binder_network_poll_data_state_1_5(
 | 
			
		||||
        rat, l.lac, l.ci);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_network_poll_data_state_1_6(
 | 
			
		||||
    BinderRegistrationState* state,
 | 
			
		||||
    BinderNetworkObject* self,
 | 
			
		||||
    const RadioRegStateResult_1_6* result)
 | 
			
		||||
{
 | 
			
		||||
    BinderNetworkLocation l;
 | 
			
		||||
    RADIO_TECH rat = result->rat;
 | 
			
		||||
 | 
			
		||||
    binder_network_location_1_5(&result->cellIdentity, &l);
 | 
			
		||||
 | 
			
		||||
    if (result->accessTechnologySpecificInfoType == RADIO_REG_ACCESS_TECHNOLOGY_SPECIFIC_INFO_EUTRAN) {
 | 
			
		||||
        RadioRegEutranRegistrationInfo *eutranInfo = (RadioRegEutranRegistrationInfo *)&result->accessTechnologySpecificInfo;
 | 
			
		||||
        RadioDataRegNrIndicators *nrIndicators = &eutranInfo->nrIndicators;
 | 
			
		||||
 | 
			
		||||
        if ((rat == RADIO_TECH_LTE || rat == RADIO_TECH_LTE_CA) &&
 | 
			
		||||
            self->nr_connected && nrIndicators->isEndcAvailable &&
 | 
			
		||||
            !nrIndicators->isDcNrRestricted &&
 | 
			
		||||
            nrIndicators->isNrAvailable) {
 | 
			
		||||
            DBG_(self, "Setting radio technology for NSA 5G");
 | 
			
		||||
            rat = RADIO_TECH_NR;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    binder_network_set_registration_state(state, result->regState,
 | 
			
		||||
        rat, l.lac, l.ci);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
binder_network_poll_data_state_aidl(
 | 
			
		||||
@@ -974,6 +1026,17 @@ binder_network_poll_data_state_cb(
 | 
			
		||||
                        max_data_calls = MAX_DATA_CALLS;
 | 
			
		||||
                        binder_network_poll_data_state_1_5(reg, self, result);
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (resp == RADIO_RESP_GET_DATA_REGISTRATION_STATE_1_6) {
 | 
			
		||||
                    const RadioRegStateResult_1_6* result =
 | 
			
		||||
                        gbinder_reader_read_hidl_struct(&reader,
 | 
			
		||||
                            RadioRegStateResult_1_6);
 | 
			
		||||
 | 
			
		||||
                    if (result) {
 | 
			
		||||
                        reg = &state;
 | 
			
		||||
                        reason = result->reasonDataDenied;
 | 
			
		||||
                        max_data_calls = MAX_DATA_CALLS;
 | 
			
		||||
                        binder_network_poll_data_state_1_6(reg, self, result);
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    ofono_error("Unexpected getDataRegistrationState response %d",
 | 
			
		||||
                        resp);
 | 
			
		||||
@@ -1067,11 +1130,21 @@ binder_network_poll_registration_state(
 | 
			
		||||
    const RADIO_AIDL_INTERFACE iface_aidl = radio_client_aidl_interface(client);
 | 
			
		||||
 | 
			
		||||
    if (iface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
        if (iface >= RADIO_INTERFACE_1_6) {
 | 
			
		||||
            self->voice_poll_req = binder_network_poll_and_retry(self,
 | 
			
		||||
                self->voice_poll_req, RADIO_REQ_GET_VOICE_REGISTRATION_STATE_1_5,
 | 
			
		||||
                binder_network_poll_voice_state_cb);
 | 
			
		||||
        } else {
 | 
			
		||||
            self->voice_poll_req = binder_network_poll_and_retry(self,
 | 
			
		||||
                self->voice_poll_req, RADIO_REQ_GET_VOICE_REGISTRATION_STATE,
 | 
			
		||||
                binder_network_poll_voice_state_cb);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (iface >= RADIO_INTERFACE_1_5) {
 | 
			
		||||
        if (iface >= RADIO_INTERFACE_1_6) {
 | 
			
		||||
            self->data_poll_req = binder_network_poll_and_retry(self,
 | 
			
		||||
                self->data_poll_req, RADIO_REQ_GET_DATA_REGISTRATION_STATE_1_6,
 | 
			
		||||
                binder_network_poll_data_state_cb);
 | 
			
		||||
        } else if (iface >= RADIO_INTERFACE_1_5) {
 | 
			
		||||
            self->data_poll_req = binder_network_poll_and_retry(self,
 | 
			
		||||
                self->data_poll_req, RADIO_REQ_GET_DATA_REGISTRATION_STATE_1_5,
 | 
			
		||||
                binder_network_poll_data_state_cb);
 | 
			
		||||
@@ -1822,6 +1895,8 @@ binder_network_set_pref(
 | 
			
		||||
 | 
			
		||||
            guint32 code = self->interface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
                RADIO_NETWORK_REQ_SET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
                iface >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
                    RADIO_REQ_SET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
                    RADIO_REQ_SET_PREFERRED_NETWORK_TYPE_BITMAP;
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
@@ -1994,6 +2069,8 @@ binder_network_query_raf_done(
 | 
			
		||||
    if (status == RADIO_TX_STATUS_OK) {
 | 
			
		||||
        guint32 code = self->interface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
            RADIO_NETWORK_RESP_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
            radio_client_interface(self->g->client) >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
                RADIO_RESP_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
                RADIO_RESP_GET_PREFERRED_NETWORK_TYPE_BITMAP;
 | 
			
		||||
 | 
			
		||||
        if (resp == code) {
 | 
			
		||||
@@ -2105,6 +2182,8 @@ binder_network_initial_rat_query(
 | 
			
		||||
                self->interface_aidl == RADIO_NETWORK_INTERFACE) {
 | 
			
		||||
        guint32 code = self->interface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
            RADIO_NETWORK_REQ_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
            iface >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
                RADIO_REQ_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
                RADIO_REQ_GET_PREFERRED_NETWORK_TYPE_BITMAP;
 | 
			
		||||
        /* getPreferredNetworkTypeBitmap(int32 serial) */
 | 
			
		||||
        req = radio_request_new2(self->g,
 | 
			
		||||
@@ -2190,6 +2269,8 @@ binder_network_query_pref_mode(
 | 
			
		||||
                self->interface_aidl == RADIO_NETWORK_INTERFACE) {
 | 
			
		||||
        guint32 code = self->interface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
            RADIO_NETWORK_REQ_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
            iface >= RADIO_INTERFACE_1_6 ?
 | 
			
		||||
                RADIO_REQ_GET_ALLOWED_NETWORK_TYPES_BITMAP :
 | 
			
		||||
                RADIO_REQ_GET_PREFERRED_NETWORK_TYPE_BITMAP;
 | 
			
		||||
        /* getPreferredNetworkTypeBitmap(int32 serial) */
 | 
			
		||||
        req = radio_request_new(client,
 | 
			
		||||
@@ -2364,16 +2445,37 @@ binder_network_current_physical_channel_configs_cb(
 | 
			
		||||
    BinderNetworkObject* self = THIS(user_data);
 | 
			
		||||
    GBinderReader reader;
 | 
			
		||||
    gboolean nr_connected = FALSE;
 | 
			
		||||
    guint32 ind_code = self->interface_aidl == RADIO_NETWORK_INTERFACE ?
 | 
			
		||||
        RADIO_NETWORK_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS :
 | 
			
		||||
        RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_4;
 | 
			
		||||
    gboolean valid_code = FALSE;
 | 
			
		||||
 | 
			
		||||
    if (self->interface_aidl == RADIO_NETWORK_INTERFACE) {
 | 
			
		||||
        if ((guint32)code == RADIO_NETWORK_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS) {
 | 
			
		||||
            valid_code = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (code == RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_4 ||
 | 
			
		||||
            code == RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_6) {
 | 
			
		||||
            valid_code = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    gbinder_reader_copy(&reader, args);
 | 
			
		||||
 | 
			
		||||
    if (code == ind_code) {
 | 
			
		||||
    if (valid_code) {
 | 
			
		||||
        guint i;
 | 
			
		||||
        if (self->interface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
            gsize count;
 | 
			
		||||
            if (code == RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_6) {
 | 
			
		||||
                const RadioPhysicalChannelConfig_1_6* configs = gbinder_reader_read_hidl_type_vec(&reader,
 | 
			
		||||
                    RadioPhysicalChannelConfig_1_6, &count);
 | 
			
		||||
 | 
			
		||||
                for (i = 0; i < count; i++) {
 | 
			
		||||
                    if (configs[i].rat == RADIO_TECH_NR &&
 | 
			
		||||
                        configs[i].connectionStatus == RADIO_CELL_CONNECTION_SECONDARY_SERVING) {
 | 
			
		||||
                        DBG_(self, "NSA 5G connected");
 | 
			
		||||
                        nr_connected = TRUE;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                const RadioPhysicalChannelConfig_1_4* configs = gbinder_reader_read_hidl_type_vec(&reader,
 | 
			
		||||
                    RadioPhysicalChannelConfig_1_4, &count);
 | 
			
		||||
 | 
			
		||||
@@ -2384,6 +2486,7 @@ binder_network_current_physical_channel_configs_cb(
 | 
			
		||||
                        nr_connected = TRUE;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            gint32 count = 0;
 | 
			
		||||
            gbinder_reader_read_int32(&reader, &count);
 | 
			
		||||
@@ -2590,6 +2693,10 @@ binder_network_new(
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
                RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_4,
 | 
			
		||||
                binder_network_current_physical_channel_configs_cb, self);
 | 
			
		||||
        self->ind_id[IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_6] =
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
                RADIO_IND_CURRENT_PHYSICAL_CHANNEL_CONFIGS_1_6,
 | 
			
		||||
                binder_network_current_physical_channel_configs_cb, self);
 | 
			
		||||
    } else {
 | 
			
		||||
        self->ind_id[IND_NETWORK_STATE] =
 | 
			
		||||
            radio_client_add_indication_handler(client,
 | 
			
		||||
 
 | 
			
		||||
@@ -93,6 +93,7 @@
 | 
			
		||||
#define BINDER_SLOT_RADIO_INTERFACE_1_3 "1.3"
 | 
			
		||||
#define BINDER_SLOT_RADIO_INTERFACE_1_4 "1.4"
 | 
			
		||||
#define BINDER_SLOT_RADIO_INTERFACE_1_5 "1.5"
 | 
			
		||||
#define BINDER_SLOT_RADIO_INTERFACE_1_6 "1.6"
 | 
			
		||||
 | 
			
		||||
static const char* const binder_radio_ifaces[] = {
 | 
			
		||||
    RADIO_1_0, /* android.hardware.radio@1.0::IRadio */
 | 
			
		||||
@@ -100,7 +101,8 @@ static const char* const binder_radio_ifaces[] = {
 | 
			
		||||
    RADIO_1_2, /* android.hardware.radio@1.2::IRadio */
 | 
			
		||||
    RADIO_1_3, /* android.hardware.radio@1.3::IRadio */
 | 
			
		||||
    RADIO_1_4, /* android.hardware.radio@1.4::IRadio */
 | 
			
		||||
    RADIO_1_5  /* android.hardware.radio@1.5::IRadio */
 | 
			
		||||
    RADIO_1_5, /* android.hardware.radio@1.5::IRadio */
 | 
			
		||||
    RADIO_1_6  /* android.hardware.radio@1.6::IRadio */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -1515,6 +1517,7 @@ binder_plugin_radio_interface_name(
 | 
			
		||||
    case RADIO_INTERFACE_1_3: return BINDER_SLOT_RADIO_INTERFACE_1_3;
 | 
			
		||||
    case RADIO_INTERFACE_1_4: return BINDER_SLOT_RADIO_INTERFACE_1_4;
 | 
			
		||||
    case RADIO_INTERFACE_1_5: return BINDER_SLOT_RADIO_INTERFACE_1_5;
 | 
			
		||||
    case RADIO_INTERFACE_1_6: return BINDER_SLOT_RADIO_INTERFACE_1_6;
 | 
			
		||||
    case RADIO_INTERFACE_NONE:
 | 
			
		||||
    case RADIO_INTERFACE_COUNT:
 | 
			
		||||
        break;
 | 
			
		||||
 
 | 
			
		||||
@@ -187,7 +187,9 @@ binder_radio_power_request_cb(
 | 
			
		||||
    guint32 code = RADIO_RESP_NONE;
 | 
			
		||||
 | 
			
		||||
    if (iface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
        code = (iface >= RADIO_INTERFACE_1_5) ?
 | 
			
		||||
        code = (iface >= RADIO_INTERFACE_1_6) ?
 | 
			
		||||
                   RADIO_RESP_SET_RADIO_POWER_1_6 :
 | 
			
		||||
                   (iface >= RADIO_INTERFACE_1_5) ?
 | 
			
		||||
                       RADIO_RESP_SET_RADIO_POWER_1_5 :
 | 
			
		||||
                       RADIO_RESP_SET_RADIO_POWER;
 | 
			
		||||
    } else if (iface_aidl == RADIO_MODEM_INTERFACE) {
 | 
			
		||||
@@ -231,7 +233,9 @@ binder_radio_submit_power_request(
 | 
			
		||||
    guint32 code = RADIO_REQ_NONE;
 | 
			
		||||
 | 
			
		||||
    if (iface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
        code = (iface >= RADIO_INTERFACE_1_5) ?
 | 
			
		||||
        code = (iface >= RADIO_INTERFACE_1_6) ?
 | 
			
		||||
               RADIO_REQ_SET_RADIO_POWER_1_6 :
 | 
			
		||||
               (iface >= RADIO_INTERFACE_1_5) ?
 | 
			
		||||
                   RADIO_REQ_SET_RADIO_POWER_1_5 :
 | 
			
		||||
                   RADIO_REQ_SET_RADIO_POWER;
 | 
			
		||||
    } else if (iface_aidl == RADIO_MODEM_INTERFACE) {
 | 
			
		||||
 
 | 
			
		||||
@@ -422,6 +422,8 @@ binder_sms_submit_cb(
 | 
			
		||||
        if (self->interface_aidl == RADIO_AIDL_INTERFACE_NONE) {
 | 
			
		||||
            if (resp == RADIO_RESP_SEND_SMS ||
 | 
			
		||||
                resp == RADIO_RESP_SEND_SMS_EXPECT_MORE ||
 | 
			
		||||
                resp == RADIO_RESP_SEND_SMS_1_6 ||
 | 
			
		||||
                resp == RADIO_RESP_SEND_SMS_EXPECT_MORE_1_6 ||
 | 
			
		||||
                resp == RADIO_RESP_SEND_IMS_SMS) {
 | 
			
		||||
                if (error == RADIO_ERROR_NONE) {
 | 
			
		||||
                    const RadioSendSmsResult* res;
 | 
			
		||||
@@ -743,12 +745,21 @@ binder_sms_send(
 | 
			
		||||
         * sendSMSExpectMore(serial, GsmSmsMessage message);
 | 
			
		||||
         */
 | 
			
		||||
        GBinderWriter writer;
 | 
			
		||||
        guint32 code = self->interface_aidl == RADIO_MESSAGING_INTERFACE ?
 | 
			
		||||
            ((flags & BINDER_SMS_SEND_FLAG_EXPECT_MORE) ?
 | 
			
		||||
        guint32 code;
 | 
			
		||||
        if (self->interface_aidl == RADIO_MESSAGING_INTERFACE) {
 | 
			
		||||
            code = ((flags & BINDER_SMS_SEND_FLAG_EXPECT_MORE) ?
 | 
			
		||||
                RADIO_MESSAGING_REQ_SEND_SMS_EXPECT_MORE :
 | 
			
		||||
                RADIO_MESSAGING_REQ_SEND_SMS) :
 | 
			
		||||
            ((flags & BINDER_SMS_SEND_FLAG_EXPECT_MORE) ?
 | 
			
		||||
                RADIO_MESSAGING_REQ_SEND_SMS);
 | 
			
		||||
        } else {
 | 
			
		||||
            if (radio_client_interface(self->g->client) >= RADIO_INTERFACE_1_6) {
 | 
			
		||||
                code = ((flags & BINDER_SMS_SEND_FLAG_EXPECT_MORE) ?
 | 
			
		||||
                    RADIO_REQ_SEND_SMS_EXPECT_MORE_1_6 :
 | 
			
		||||
                    RADIO_REQ_SEND_SMS_1_6);
 | 
			
		||||
            } else  {
 | 
			
		||||
                code = ((flags & BINDER_SMS_SEND_FLAG_EXPECT_MORE) ?
 | 
			
		||||
                    RADIO_REQ_SEND_SMS_EXPECT_MORE : RADIO_REQ_SEND_SMS);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        RadioRequest* req = radio_request_new2(self->g,
 | 
			
		||||
            code, &writer,
 | 
			
		||||
            binder_sms_submit_cb, binder_sms_submit_cbd_free,
 | 
			
		||||
 
 | 
			
		||||
@@ -574,6 +574,11 @@ binder_radio_error_string(
 | 
			
		||||
    RADIO_ERROR_STR_(DEVICE_IN_USE);
 | 
			
		||||
    RADIO_ERROR_STR_(ABORTED);
 | 
			
		||||
    RADIO_ERROR_STR_(INVALID_RESPONSE);
 | 
			
		||||
    RADIO_ERROR_STR_(SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED);
 | 
			
		||||
    RADIO_ERROR_STR_(ACCESS_BARRED);
 | 
			
		||||
    RADIO_ERROR_STR_(BLOCKED_DUE_TO_CALL);
 | 
			
		||||
    RADIO_ERROR_STR_(RF_HARDWARE_ISSUE);
 | 
			
		||||
    RADIO_ERROR_STR_(NO_RF_CALIBRATION_INFO);
 | 
			
		||||
    RADIO_ERROR_STR_(OEM_ERROR_1);
 | 
			
		||||
    RADIO_ERROR_STR_(OEM_ERROR_2);
 | 
			
		||||
    RADIO_ERROR_STR_(OEM_ERROR_3);
 | 
			
		||||
 
 | 
			
		||||
@@ -769,6 +769,19 @@ binder_voicecall_clcc_poll_cb(
 | 
			
		||||
                                binder_voicecall_info_compare);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (resp == RADIO_RESP_GET_CURRENT_CALLS_1_6) {
 | 
			
		||||
                    const RadioCall_1_6* calls =
 | 
			
		||||
                        gbinder_reader_read_hidl_type_vec(&reader,
 | 
			
		||||
                            RadioCall_1_6, &count);
 | 
			
		||||
 | 
			
		||||
                    if (calls) {
 | 
			
		||||
                        /* Build sorted list */
 | 
			
		||||
                        for (i = 0; i < count; i++) {
 | 
			
		||||
                            list = g_slist_insert_sorted(list,
 | 
			
		||||
                                binder_voicecall_info_new(&calls[i].base.base),
 | 
			
		||||
                                binder_voicecall_info_compare);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    ofono_error("Unexpected getCurrentCalls response %d", resp);
 | 
			
		||||
                }
 | 
			
		||||
@@ -829,9 +842,16 @@ binder_voicecall_clcc_poll(
 | 
			
		||||
{
 | 
			
		||||
    if (!self->clcc_poll_req) {
 | 
			
		||||
        /* getCurrentCalls(int32 serial); */
 | 
			
		||||
        guint32 code = self->interface_aidl == RADIO_VOICE_INTERFACE ?
 | 
			
		||||
            RADIO_VOICE_REQ_GET_CURRENT_CALLS :
 | 
			
		||||
            RADIO_REQ_GET_CURRENT_CALLS;
 | 
			
		||||
        guint32 code;
 | 
			
		||||
        if (self->interface_aidl == RADIO_VOICE_INTERFACE) {
 | 
			
		||||
            code = RADIO_VOICE_REQ_GET_CURRENT_CALLS;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (radio_client_interface(self->g->client) >= RADIO_INTERFACE_1_6) {
 | 
			
		||||
                code = RADIO_REQ_GET_CURRENT_CALLS_1_6;
 | 
			
		||||
            } else {
 | 
			
		||||
                code = RADIO_REQ_GET_CURRENT_CALLS;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        RadioRequest* req = radio_request_new2(self->g,
 | 
			
		||||
            code, NULL,
 | 
			
		||||
            binder_voicecall_clcc_poll_cb, NULL, self);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user