Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 660c2e18 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Merge "bluetooth: hid: store ssr_max_latency and ssr_min_tout in bonding db" into klp-modular-dev

parents db709da1 a6eb8059
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -236,7 +236,8 @@ bt_status_t btif_storage_add_hid_device_info(bt_bdaddr_t *remote_bd_addr,
                                                    UINT16 attr_mask, UINT8 sub_class,
                                                    UINT8 app_id, UINT16 vendor_id,
                                                    UINT16 product_id, UINT16 version,
                                                    UINT8 ctry_code, UINT16 dl_len, UINT8 *dsc_list);
                                                    UINT8 ctry_code, UINT16 ssr_max_latency,
                                                    UINT16 ssr_min_tout, UINT16 dl_len, UINT8 *dsc_list);

/*******************************************************************************
**
+1 −0
Original line number Diff line number Diff line
@@ -983,6 +983,7 @@ static void btif_hh_upstreams_evt(UINT16 event, char* p_param)
                    ret = btif_storage_add_hid_device_info(&(p_dev->bd_addr), p_dev->attr_mask,p_dev->sub_class,p_dev->app_id,
                                                        p_data->dscp_info.vendor_id, p_data->dscp_info.product_id,
                                                        p_data->dscp_info.version,   p_data->dscp_info.ctry_code,
                                                        p_data->dscp_info.ssr_max_latency, p_data->dscp_info.ssr_min_tout,
                                                        len, p_data->dscp_info.descriptor.dsc_list);

                    ASSERTC(ret == BT_STATUS_SUCCESS, "storing hid info failed", ret);
+14 −1
Original line number Diff line number Diff line
@@ -1359,7 +1359,8 @@ bt_status_t btif_storage_add_hid_device_info(bt_bdaddr_t *remote_bd_addr,
                                                    UINT16 attr_mask, UINT8 sub_class,
                                                    UINT8 app_id, UINT16 vendor_id,
                                                    UINT16 product_id, UINT16 version,
                                                    UINT8 ctry_code, UINT16 dl_len, UINT8 *dsc_list)
                                                    UINT8 ctry_code, UINT16 ssr_max_latency,
                                                    UINT16 ssr_min_tout, UINT16 dl_len, UINT8 *dsc_list)
{
    bdstr_t bdstr;
    BTIF_TRACE_DEBUG0("btif_storage_add_hid_device_info:");
@@ -1371,6 +1372,8 @@ bt_status_t btif_storage_add_hid_device_info(bt_bdaddr_t *remote_bd_addr,
    btif_config_set_int("Remote", bdstr, "HidProductId", product_id);
    btif_config_set_int("Remote", bdstr, "HidVersion", version);
    btif_config_set_int("Remote", bdstr, "HidCountryCode", ctry_code);
    btif_config_set_int("Remote", bdstr, "HidSSRMaxLatency", ssr_max_latency);
    btif_config_set_int("Remote", bdstr, "HidSSRMinTimeout", ssr_min_tout);
    if(dl_len > 0)
        btif_config_set("Remote", bdstr, "HidDescriptor", (const char*)dsc_list, dl_len,
                        BTIF_CFG_TYPE_BIN);
@@ -1431,6 +1434,14 @@ bt_status_t btif_storage_load_bonded_hid_info(void)
            btif_config_get_int("Remote", kname, "HidCountryCode", &value);
            dscp_info.ctry_code = (uint8_t) value;

            value = 0;
            btif_config_get_int("Remote", kname, "HidSSRMaxLatency", &value);
            dscp_info.ssr_max_latency = (uint16_t) value;

            value = 0;
            btif_config_get_int("Remote", kname, "HidSSRMinTimeout", &value);
            dscp_info.ssr_min_tout = (uint16_t) value;

            int len = 0;
            int type;
            btif_config_get("Remote", kname, "HidDescriptor", NULL, &len, &type);
@@ -1477,6 +1488,8 @@ bt_status_t btif_storage_remove_hid_info(bt_bdaddr_t *remote_bd_addr)
    btif_config_remove("Remote", bdstr, "HidProductId");
    btif_config_remove("Remote", bdstr, "HidVersion");
    btif_config_remove("Remote", bdstr, "HidCountryCode");
    btif_config_remove("Remote", bdstr, "HidSSRMaxLatency");
    btif_config_remove("Remote", bdstr, "HidSSRMinTimeout");
    btif_config_remove("Remote", bdstr, "HidDescriptor");
    btif_config_save();
    return BT_STATUS_SUCCESS;