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

Commit e4de84fe authored by Matthew Xie's avatar Matthew Xie
Browse files

For pairing over le transport, set default device type and address type

When the LE pairing is initiated over NFC, skipping device scan, there is
no device type or address type info. We set the default as le and public.
bug 17497942
Change-Id: I3dcbb9029ead6ea0f7c48e62f46c8a055f1bc293
parent 5c058990
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -598,6 +598,17 @@ static void btif_dm_cb_create_bond(bt_bdaddr_t *bd_addr, tBTA_TRANSPORT transpor
    int addr_type;
    bdstr_t bdstr;
    bd2str(bd_addr, &bdstr);
    if (transport == BT_TRANSPORT_LE)
    {
        if (!btif_config_get_int("Remote", (char const *)&bdstr,"DevType", &device_type))
        {
            btif_config_set_int("Remote", bdstr, "DevType", BT_DEVICE_TYPE_BLE);
        }
        if (btif_storage_get_remote_addr_type(bd_addr, &addr_type) != BT_STATUS_SUCCESS)
        {
            btif_storage_set_remote_addr_type(bd_addr, BLE_ADDR_PUBLIC);
        }
    }
    if((btif_config_get_int("Remote", (char const *)&bdstr,"DevType", &device_type) &&
       (btif_storage_get_remote_addr_type(bd_addr, &addr_type) == BT_STATUS_SUCCESS) &&
       (device_type == BT_DEVICE_TYPE_BLE)) || (transport == BT_TRANSPORT_LE))