From 14509d9e2f66819b60dcf40dfba5c49949a61b40 Mon Sep 17 00:00:00 2001
From: dianlujitao <dianlujitao@lineageos.org>
Date: Mon, 25 May 2020 11:15:11 +0800
Subject: [PATCH] sm6250-common: Switch to QTI bt stack

Change-Id: I47016b066ae800d0071dbad6a1235cbc9db3cf80
---
 BoardConfigCommon.mk                           |  1 +
 bluetooth/include/bdroid_buildcfg.h            |  6 +++---
 common.mk                                      | 10 ++++++++--
 .../apps/Bluetooth/res/values/config.xml       |  2 --
 .../apps/Bluetooth/res/values/config.xml       | 18 ++++++++++++++++++
 5 files changed, 30 insertions(+), 7 deletions(-)
 rename {overlay => overlay-system/vendor/qcom/opensource/commonsys}/packages/apps/Bluetooth/res/values/config.xml (89%)
 create mode 100644 overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml

diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 5da170f..a653896 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -132,6 +132,7 @@ TARGET_VENDOR_PROP += $(COMMON_PATH)/vendor.prop
 
 # QCOM
 BOARD_USES_QCOM_HARDWARE := true
+TARGET_FWK_SUPPORTS_FULL_VALUEADDS := true
 
 # Recovery
 BOARD_INCLUDE_RECOVERY_DTBO := true
diff --git a/bluetooth/include/bdroid_buildcfg.h b/bluetooth/include/bdroid_buildcfg.h
index 8fe4885..931b0e4 100644
--- a/bluetooth/include/bdroid_buildcfg.h
+++ b/bluetooth/include/bdroid_buildcfg.h
@@ -58,12 +58,12 @@ static inline const char *BtmGetDefaultName()
 #define BTM_DEF_LOCAL_NAME BtmGetDefaultName()
 // Disables read remote device feature
 #define MAX_ACL_CONNECTIONS   16
-#define MAX_L2CAP_CHANNELS    16
+#define MAX_L2CAP_CHANNELS    32
 #define BLE_VND_INCLUDED   TRUE
+#define GATT_MAX_PHY_CHANNEL  10
 // Skips conn update at conn completion
 #define BT_CLEAN_TURN_ON_DISABLED 1
-// Increasing SEPs to 12 from 6 to support SHO/MCast i.e. two streams per codec
-#define AVDT_NUM_SEPS 12
+#define AVDT_NUM_SEPS 35
 
 #pragma pop_macro("PROPERTY_VALUE_MAX")
 
diff --git a/common.mk b/common.mk
index c3eb136..84138e9 100644
--- a/common.mk
+++ b/common.mk
@@ -36,6 +36,10 @@ PRODUCT_PACKAGES += \
     r-gsi.avbpubkey \
     s-gsi.avbpubkey
 
+# Bluetooth
+PRODUCT_PACKAGES += \
+    BluetoothQti
+
 # Camera
 PRODUCT_PACKAGES += \
     Snap
@@ -74,12 +78,14 @@ PRODUCT_COPY_FILES += \
 # Overlays
 DEVICE_PACKAGE_OVERLAYS += \
     $(LOCAL_PATH)/overlay \
-    $(LOCAL_PATH)/overlay-lineage
+    $(LOCAL_PATH)/overlay-lineage \
+    $(LOCAL_PATH)/overlay-system
 
 PRODUCT_ENFORCE_RRO_TARGETS := *
 PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \
     $(LOCAL_PATH)/overlay-lineage/lineage-sdk \
-    $(LOCAL_PATH)/overlay-lineage/packages/apps/Snap
+    $(LOCAL_PATH)/overlay-lineage/packages/apps/Snap \
+    $(LOCAL_PATH)/overlay-system
 
 # Partitions
 PRODUCT_USE_DYNAMIC_PARTITIONS := true
diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml
similarity index 89%
rename from overlay/packages/apps/Bluetooth/res/values/config.xml
rename to overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml
index debb01a..208c78c 100644
--- a/overlay/packages/apps/Bluetooth/res/values/config.xml
+++ b/overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml
@@ -13,9 +13,7 @@
      limitations under the License.
 -->
 <resources>
-    <bool name="profile_supported_a2dp_sink">true</bool>
     <bool name="profile_supported_avrcp_controller">true</bool>
-    <bool name="profile_supported_avrcp_target">false</bool>
     <bool name="profile_supported_ba">true</bool>
     <bool name="profile_supported_hfpclient">false</bool>
     <bool name="profile_supported_hid_device">false</bool>
diff --git a/overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml b/overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml
new file mode 100644
index 0000000..2cdd2fc
--- /dev/null
+++ b/overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2020 The LineageOS Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <bool name="profile_supported_a2dp_sink">true</bool>
+    <bool name="profile_supported_avrcp_target">false</bool>
+</resources>
-- 
GitLab