Add dynamic bluetooth config (requires system/bt changes)
diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h
new file mode 100644
index 0000000..4ec3b5c
--- /dev/null
+++ b/bluetooth/bdroid_buildcfg.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Not a Contribution, Apache license notifications and license are retained
+ * for attribution purposes only.
+ *
+ * Copyright (C) 2012 The Android Open Source 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.
+ */
+
+#ifndef _BDROID_BUILDCFG_H
+#define _BDROID_BUILDCFG_H
+
+#include <cutils/properties.h>
+#include <string.h>
+
+static inline const char* BtmDefLocalName()
+{
+ static char product_device[PROPERTY_VALUE_MAX];
+ //Huawei-defined property
+ property_get("ro.config.marketing_name", product_device, "");
+
+ if (strcmp(product_device, "") != 0)
+ return product_device;
+
+ // Fallback to ro.product.model
+ return "";
+}
+
+static inline bool BtmBypassExtraAclSetup() {
+ int8_t prop = property_get_bool("persist.sys.bt_acl_bypass", false);
+ return prop == true;
+}
+
+#define BTM_DEF_LOCAL_NAME BtmDefLocalName()
+#define BTM_BYPASS_EXTRA_ACL_SETUP BtmBypassExtraAclSetup()
+
+#endif
diff --git a/phhgsi_arm64_a/BoardConfig.mk b/phhgsi_arm64_a/BoardConfig.mk
index 0332d3d..e2d7ee3 100644
--- a/phhgsi_arm64_a/BoardConfig.mk
+++ b/phhgsi_arm64_a/BoardConfig.mk
@@ -2,3 +2,4 @@
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
TARGET_SYSTEM_PROP := device/phh/treble/system.prop $(TARGET_SYSTEM_PROP)
+BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/phh/treble/bluetooth
diff --git a/phhgsi_arm64_ab/BoardConfig.mk b/phhgsi_arm64_ab/BoardConfig.mk
index f2553e4..96b7b98 100644
--- a/phhgsi_arm64_ab/BoardConfig.mk
+++ b/phhgsi_arm64_ab/BoardConfig.mk
@@ -2,3 +2,4 @@
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
TARGET_SYSTEM_PROP := device/phh/treble/system.prop $(TARGET_SYSTEM_PROP)
+BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/phh/treble/bluetooth
diff --git a/vndk-detect b/vndk-detect
index 3529a8a..965c42c 100644
--- a/vndk-detect
+++ b/vndk-detect
@@ -10,3 +10,6 @@
done
mount -o bind /system/bin/adbd /sbin/adbd
+if getprop ro.hardware |grep -q kirin970;then
+ setprop persist.sys.bt_acl_bypass true
+fi