From ffa472d899b2da5b3ea93acb24d466a223713cc0 Mon Sep 17 00:00:00 2001 From: pythonlimited Date: Sat, 3 Aug 2019 15:40:02 +0200 Subject: [PATCH] sdm660-common: bluetooth: set bt name from ro.product.model --- bluetooth/bdroid_buildcfg.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h index 2691bb74..545648b8 100644 --- a/bluetooth/bdroid_buildcfg.h +++ b/bluetooth/bdroid_buildcfg.h @@ -21,6 +21,31 @@ #ifndef _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H + +#include +#include + +static inline const char* BtmGetDefaultName() +{ + char product_model[PROPERTY_VALUE_MAX]; + property_get("ro.product.model", product_model, ""); + + if (strstr(product_model, "Mi A2")) + return "Mi A2"; + if (strstr(product_model, "MI 6X")) + return "MI 6X"; + if (strstr(product_model, "MI PAD 4")) + return "MI PAD 4"; + if (strstr(product_model, "MI PAD 4 PLUS")) + return "MI PAD 4 PLUS"; + + // Fallback to ro.product.model + return ""; +} +#undef PROPERTY_VALUE_MAX + +#define BTM_DEF_LOCAL_NAME BtmGetDefaultName() +#define BLUETOOTH_QTI_SW TRUE // Disables read remote device feature #define MAX_ACL_CONNECTIONS 16 #define MAX_L2CAP_CHANNELS 16