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

Commit 16cf203a authored by Nitin Arora's avatar Nitin Arora Committed by Android Git Automerger
Browse files

am 3a2c94bc: Update device type correctly in the NVRAM at inquiry result

* commit '3a2c94bc':
  Update device type correctly in the NVRAM at inquiry result
parents 774b1186 3a2c94bc
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -1314,9 +1314,9 @@ static void btif_dm_search_devices_evt (UINT16 event, char *p_param)
            {
                bt_property_t properties[5];
                bt_device_type_t dev_type;
                UINT8 addr_type;
                uint32_t num_properties = 0;
                bt_status_t status;
                int addr_type = 0;

                memset(properties, 0, sizeof(properties));
                /* BD_ADDR */
@@ -1340,7 +1340,20 @@ static void btif_dm_search_devices_evt (UINT16 event, char *p_param)
                /* DEV_TYPE */
#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
                /* FixMe: Assumption is that bluetooth.h and BTE enums match */

                /* Verify if the device is dual mode in NVRAM */
                int stored_device_type = 0;
                if (btif_get_device_type(bdaddr.address, &stored_device_type) &&
                    ((stored_device_type == BT_DEVICE_TYPE_BLE &&
                        p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BREDR) ||
                     (stored_device_type == BT_DEVICE_TYPE_BREDR &&
                        p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BLE))) {
                    dev_type = BT_DEVICE_TYPE_DUMO;
                } else {
                    dev_type = p_search_data->inq_res.device_type;
                }

                if (p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BLE)
                    addr_type = p_search_data->inq_res.ble_addr_type;
#else
                dev_type = BT_DEVICE_TYPE_BREDR;