--- /home/bumerc/lineage-20/packages/modules/Bluetooth/system/gd/hci/controller.cc 2024-11-10 13:58:37.704468094 +0100 +++ /home/bumerc/los-20/packages/modules/Bluetooth/system/gd/hci/controller.cc 2024-11-10 14:47:19.829927901 +0100 @@ -33,6 +33,9 @@ namespace hci { static const char kPropertyDisabledCommands[] = "bluetooth.hci.disabled_commands"; + +static const char kPropertyVendorCapabilitiesMax[] = + "bluetooth.hci.max_vendor_cap"; using os::Handler; @@ -451,6 +454,14 @@ struct Controller::impl { if (complete_view.IsValid()) { vendor_capabilities_.is_supported_ = 0x01; + + int vendor_cap_max = 0xffff; + std::string vendor_cap_max_prop = os::GetSystemProperty(kPropertyVendorCapabilitiesMax).value_or(""); + if (vendor_cap_max_prop != "") { + vendor_cap_max = std::stoi(vendor_cap_max_prop); + } + + if (vendor_cap_max < 55) return; // v0.55 BaseVendorCapabilities base_vendor_capabilities = complete_view.GetBaseVendorCapabilities(); @@ -466,6 +477,8 @@ struct Controller::impl { vendor_capabilities_.version_supported_ = 55; return; } + + if (vendor_cap_max < 95) return; // v0.95 auto v95 = LeGetVendorCapabilitiesComplete095View::Create(complete_view); @@ -480,6 +493,8 @@ struct Controller::impl { if (vendor_capabilities_.version_supported_ <= 95 || complete_view.GetPayload().size() == 0) { return; } + + if (vendor_cap_max < 96) return; // v0.96 auto v96 = LeGetVendorCapabilitiesComplete096View::Create(v95); @@ -492,6 +507,8 @@ struct Controller::impl { return; } + if (vendor_cap_max < 98) return; + // v0.98 auto v98 = LeGetVendorCapabilitiesComplete098View::Create(v96); if (!v98.IsValid()) {