Android修改蓝牙名称
本文基于Android5.1代码
修改蓝牙默认名称的4种方法
方法一:
vendor\mediatek\proprietary\frameworks\base\custom\custom.conf
# [usage]
# format-> m.n=v
# m -> module definition, support wildcards
# p -> property name, used as key, case sensitive
# v -> property value
#
# [example]
# mms.UserAgent = Android 4.0/Release 01.05.2012
# bluetooth.HostName = BtDevice
# *.UAProfileURL = http://www.google.com/UAProf.xml
#
# [notice]
# CR/LF used as only delimiter of each configuaration items, both LINUX/MAC/DOS format supported
# character set: ASCII, encoding type: UTF8#browser.UserAgent = Athens15_TD/V2 Linux/3.0.13 Android/4.0 Release/02.15.2012 Browser/AppleWebKit534.30 Mobile Safari/534.30 System/Android 4.0.1;
browser.UAProfileURL = http://218.249.47.94/Xianghe/MTK_Phone_KK_UAprofile.xml
mms.UserAgent = Android-Mms/0.1
mms.UAProfileURL = http://www.google.com/oha/rdf/ua-profile-kila.xml
http_streaming.UserAgent = stagefright/1.2 (Linux;Android @ro.build.version.release )
rtsp_streaming.UserAgent = stagefright/1.2 (Linux;Android @ro.build.version.release )
#http_streaming.UAProfileURL = http://218.249.47.94/Xianghe/MTK_Athens15_UAProfile.xml
#rtsp_streaming.UAProfileURL = http://218.249.47.94/Xianghe/MTK_Athens15_UAProfile.xml
dm.Manufacturer = Aguri
dm.Model = RV750 EU
bluetooth.HostName = AGR750 //修改默认蓝牙名称
fmtransmitter.RDSValue = Mediatek
wlan.SSID = AGR750 //修改默认wifi名称
方法二:
external\bluetooth\bluedroid\btif\src\btif_dm.c
btif_default_local_name[]数组为null
static char btif_default_local_name[DEFAULT_LOCAL_NAME_MAX+1] = {'\0'};
//修改为需要客制化的名称,例如:AGR750
static char btif_default_local_name[DEFAULT_LOCAL_NAME_MAX+1] = "AGR750";
方法三:
前提条件:
btif_default_local_name[] 数组的默认定义为空(也就是方法二中的数组)
static char btif_default_local_name[DEFAULT_LOCAL_NAME_MAX+1] = {'\0'};
修改device\generic\common\bluetooth\bdroid_buildcfg.h文件中de中的的蓝牙名宏M_DEF_LOCAL_NAME
/** 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#define BTM_DEF_LOCAL_NAME "" //修改默认蓝牙名 例:"AGR750"#endif
方法四:(最为繁琐)
前提条件:
(1) btif_default_local_name[] 数组的默认定义为空(也就是方法二数组)
static char btif_default_local_name[DEFAULT_LOCAL_NAME_MAX+1] = {'\0'};
(2) external\libnfc-nci\src\include\bt_target.h或 external\bluetooth\bluedroid\include\bt_target.h
文件中蓝牙名称宏定义BTM_DEF_LOCAL_NAME为空
#ifndef BTM_DEF_LOCAL_NAME
#define BTM_DEF_LOCAL_NAME ""
#endif
(3) device\generic\common\bluetooth\bdroid_buildcfg.h文件中的蓝牙名宏M_DEF_LOCAL_NAME(参考方法三)
/** 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#define BTM_DEF_LOCAL_NAME "" //修改默认蓝牙名 例:"AGR750"#endif
修改方法:
满足上面的前提条件,此时默认的蓝牙名称会读取 ro.product.model 属性值作为蓝牙默认名称;
在文件external\bluetooth\bluedroid\btif\src\btif_dm.c中已定义:
#define PROPERTY_PRODUCT_MODEL "ro.product.model"
在通过vendor\mediatek\proprietary\frameworks\base\custom\custom.conf(方法一)中
bluetooth.HostName =@ro.product.model // @来指定默认蓝牙
该property值得设置在:device\mediatek\common\custom.conf 文件中 bluetooth.HostName =@ro.product.model
ro.product.model定义:build\tools\buildinfo.sh中 echo "ro.product.model= AGR750 "
以上就是修改蓝牙默认名称所有方法。尤其方法四最为繁琐、最接地气,你试试看看,O(∩_∩)O哈哈~
Android修改蓝牙名称相关推荐
- android修改蓝牙名称,如何从Android智能手机中更改蓝牙名称
每次将Bluetooth外设连接到Android平板电脑或智能手机时,都会看到型号名称.在大多数情况下,这足以确定它是哪个小部件.在某些情况下,显示型号名称可能会使您感到困惑,尤其是当您在周边看到一长 ...
- CC2541修改蓝牙名称为中文名称
CC2541修改蓝牙名称为中文名称 CC2541的中文名称支持使用URL编码,可以使用URL编码转换器,如在百度搜索URL在线转换 例如输入我,点击URL编码,生成了%E6%88%91.我们这里使用三 ...
- BES2300x笔记(6) -- 如何修改蓝牙名称
哈喽大家好,这是该系列博文的第六篇~ 篇~ <<[系列博文索引]快速通道 >> 一.前言 有时,销售对接的客户需要送样,就想拿仓库现有的产品改下蓝牙名称,然后寄给客户,但咨询过 ...
- android修改MTP及MTP(PC显示名称)、PTP盘符名、蓝牙名称
本文是基于Android5.1的代码 PTP修改: 路径:frameworks\av\media\mtp\MtpServer.cpp if (mPtp) { // no extensions stri ...
- CC2541-修改蓝牙名称和mac地址
使用的蓝牙芯片是CC2541, 本文章介绍修改蓝牙名称和蓝牙MAC地址的方法. 修改蓝牙名称: 在数组scanRspData[ ]里,存放的就是蓝牙名称,你可以自己设置.GAPRole_SetPara ...
- Android8.1 MTK平台 修改蓝牙默认名称
8.1 的默认蓝牙名称为 Android Bluedroid 通过搜索你会找到如下文件 device/generic/common/bluetooth/bdroid_buildcfg.h #ifnde ...
- android蓝牙设置名称流程,Android 8 设置蓝牙名称 流程
记录android 8设置蓝牙名称的流程.java packages/apps/Settings/src/com/android/settings/bluetooth/BluetoothDeviceR ...
- android gradle 设置 output文件名,Android gradle build 修改文件名称及目录
Android gradle build 修改文件名称及目录 android 在build的时候.输出apk的位置在于工程目录下的build文件夹下,名称也是固定的,但是在某些场景下需要对apk进行重 ...
- android 工程名怎么改,Android Studio修改项目名称和包名方法
平时项目开发中,有时候维护项目多,有的项目结构需要改变,这就需要我们去修改项目名称或者修改包名.下面介绍一下怎样修改项目名称和包名. 1. 修改项目名称 1)打开项目根目录下的setting.grad ...
最新文章
- GitHub有趣分享:Thanos(灭霸命令)
- 国内35所人工智能学院大盘点
- 计算机教室内网连接不了,校园网登陆不了内网怎么办?校园网登陆不了内网的解决方法...
- 生产环境可以用吗_小型熔喷布设备可以生产出好的熔喷布吗?
- java.lang包—枚举类Enum
- android 按键会触发ontouch吗?_这次,我把Android事件分发机制翻了个遍
- [html] iframe如何自动调整高度?
- (41)时钟组Clock Group介绍
- php导入跟引入的区别,PHP7 引入的“??” 和“?:”的区别
- C++新特性探究(十六):move constructor移动构造
- “使用 iNalyzer 分析应用程序的类结构”
- PRML 模式识别与机器学习 1.绪论
- 产品经理面试题汇总(1)
- Games101-课程13笔记
- PS制作五彩抽象人像
- NuttX的学习笔记 9
- 屏蔽掉Linux上运行Spark(Python版)时的多余信息(INFO)
- CCF计算机软件能力认证试题练习:201612-2 工资计算
- SDK Manager安装
- ipad协议/8.0.37/个微协议
热门文章
- Python调用大华SDK:实现视频监控系统
- 计算机设备机房防静电标准,机房防静电地板设计标准是什么
- 保弘实业|个人理财如何才能做到收益最高
- “经历了人生百态世间的冷暖,这笑容温暖纯真”
- Exata卫星通信仿真
- 逆战小白提升日記——网红时钟罗盘制作
- webapi json返回值null替换为空字符串
- 【数据库】 关系模式的规范化理论----一文让你轻松理解其中奥秘
- 文件同步详细操作(NFS,rsync)
- libpng error: iTXt: chunk data is too large error: PNG unsigned integer out of range