sm6250-common: Switch to a map based BT name
Change-Id: I6e0457441c5d2e7fd936d117439a90ae84496dc2
This commit is contained in:
parent
23094912ff
commit
2087946c9d
@ -5,6 +5,7 @@
|
||||
* for attribution purposes only.
|
||||
*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
* Copyright (C) 2018 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.
|
||||
@ -22,6 +23,37 @@
|
||||
#ifndef _BDROID_BUILDCFG_H
|
||||
#define _BDROID_BUILDCFG_H
|
||||
|
||||
#include <cutils/properties.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "osi/include/osi.h"
|
||||
|
||||
typedef struct {
|
||||
const char *product_device;
|
||||
const char *product_model;
|
||||
} device_t;
|
||||
|
||||
static const device_t devices[] = {
|
||||
};
|
||||
|
||||
static inline const char *BtmGetDefaultName()
|
||||
{
|
||||
char product_device[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.product.device", product_device, "");
|
||||
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(devices); i++) {
|
||||
device_t device = devices[i];
|
||||
|
||||
if (strcmp(device.product_device, product_device) == 0) {
|
||||
return device.product_model;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to ro.product.model
|
||||
return "";
|
||||
}
|
||||
|
||||
#define BTM_DEF_LOCAL_NAME BtmGetDefaultName()
|
||||
// Disables read remote device feature
|
||||
#define MAX_ACL_CONNECTIONS 16
|
||||
#define MAX_L2CAP_CHANNELS 16
|
||||
|
Loading…
Reference in New Issue
Block a user