Add dynamic bluetooth config (requires system/bt changes)

This commit is contained in:
Pierre-Hugues Husson 2018-02-20 23:03:30 +01:00
parent 9dccd6e70e
commit c4ccbd9752
4 changed files with 53 additions and 0 deletions

View File

@ -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

View File

@ -2,3 +2,4 @@ include build/make/target/board/generic_arm64_a/BoardConfig.mk
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

View File

@ -2,3 +2,4 @@ include build/make/target/board/generic_arm64_ab/BoardConfig.mk
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

View File

@ -10,3 +10,6 @@ while read version;do
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