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

Commit 283ea50c authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Retrieve CoD from storage when a new LE device record is created

Test: mmm packages/modules/Bluetooth
Flag: com.android.bluetooth.flags.read_le_appearance
Bug: 286334644
Bug: 362367900
Change-Id: I39f94b708c4fcae50f2866969d4514b498ed5259
parent 5367eb82
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -106,6 +106,16 @@ void BTM_SecAddBleDevice(const RawAddress& bd_addr, tBT_DEVICE_TYPE dev_type,
                                            reinterpret_cast<char*>(&p_dev_rec->sec_bd_name))) {
      p_dev_rec->sec_rec.sec_flags |= BTM_SEC_NAME_KNOWN;
    }

    uint32_t cod = 0;
    if (com::android::bluetooth::flags::read_le_appearance() &&
        btif_storage_get_cod(bd_addr, &cod)) {
      DEV_CLASS dev_class = {};
      dev_class[2] = (uint8_t)cod;
      dev_class[1] = (uint8_t)(cod >> 8);
      dev_class[0] = (uint8_t)(cod >> 16);
      p_dev_rec->dev_class = dev_class;
    }
  }

  if (!com::android::bluetooth::flags::name_discovery_for_le_pairing()) {