1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 10:56:22 +00:00
treble_evolution/patches/platform_packages_modules_Bluetooth/0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch
2024-04-24 15:13:17 +00:00

57 lines
1.8 KiB
Diff

From 9479230f72b637a2eb023f02cd1ff4c754e541a7 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 30 May 2023 17:34:03 -0400
Subject: [PATCH 7/9] Add a property to cap declared le vendor version. Found
needed on unisoc
---
system/gd/hci/controller.cc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
index 645c74e868..ffc2b149fe 100644
--- a/system/gd/hci/controller.cc
+++ b/system/gd/hci/controller.cc
@@ -618,6 +618,13 @@ struct Controller::impl {
if (complete_view.IsValid()) {
vendor_capabilities_.is_supported_ = 0x01;
+ int vendor_cap_max = 0xffff;
+ std::string vendor_cap_max_prop = GetSystemProperty("persist.sys.bt.max_vendor_cap").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();
vendor_capabilities_.max_advt_instances_ = base_vendor_capabilities.max_advt_instances_;
@@ -633,6 +640,8 @@ struct Controller::impl {
return;
}
+ if (vendor_cap_max < 95) return;
+
// v0.95
auto v95 = LeGetVendorCapabilitiesComplete095View::Create(complete_view);
if (!v95.IsValid()) {
@@ -647,6 +656,7 @@ struct Controller::impl {
return;
}
+ if (vendor_cap_max < 96) return;
// v0.96
auto v96 = LeGetVendorCapabilitiesComplete096View::Create(v95);
if (!v96.IsValid()) {
@@ -658,6 +668,7 @@ struct Controller::impl {
return;
}
+ if (vendor_cap_max < 98) return;
// v0.98
auto v98 = LeGetVendorCapabilitiesComplete098View::Create(v96);
if (!v98.IsValid()) {
--
2.25.1