Android16 蓝牙打开时,状态栏显示蓝牙图标
说明本修改主要针对 Android 16API 36AOSP 源码中的 SystemUI 模块。项目内容适用版本Android 16API 36涉及模块frameworks/base/packages/SystemUI修改类PhoneStatusBarPolicy修改方法updateBluetooth()在 Android 16 原生 SystemUI 中PhoneStatusBarPolicy.updateBluetooth()默认仅在蓝牙已连接且满足音频 Profile 条件时才显示状态栏图标。用户仅打开蓝牙开关、尚未连接设备时状态栏不会出现蓝牙图标与快捷设置中蓝牙已开启的状态不一致。本次修改在 Android 16 上实现蓝牙开启即显示stat_sys_data_bluetooth图标新增资源蓝牙已连接时切换为stat_sys_data_bluetooth_connected图标蓝牙关闭时隐藏图标若移植到其他 Android 版本需确认对应分支中PhoneStatusBarPolicy.java路径及updateBluetooth()实现是否一致资源命名是否相同。修改文件frameworks/base/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml (新增) frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java (修改)1. 新增stat_sys_data_bluetooth.xml路径frameworks/base/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml!-- Copyright (C) 2017 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. --vectorxmlns:androidhttp://schemas.android.com/apk/res/androidandroid:width17dpandroid:height17dpandroid:viewportWidth17.0android:viewportHeight17.0groupandroid:translateY0.5android:translateX0.5pathandroid:pathDataM8.84,8l2.62,-2.62c0.29,-0.29 0.29,-0.75 0,-1.04L8.33,1.22L8.31,1.2c-0.3,-0.28 -0.76,-0.26 -1.03,0.04c-0.13,0.13 -0.2,0.31 -0.2,0.5v4.51L4.24,3.4c-0.29,-0.29 -0.74,-0.29 -1.03,0s-0.29,0.74 0,1.03L6.78,8l-3.56,3.56c-0.29,0.29 -0.29,0.74 0,1.03s0.74,0.29 1.03,0l2.83,-2.83v4.51c0,0.4 0.33,0.73 0.73,0.73c0.18,0 0.36,-0.07 0.5,-0.2l0.03,-0.03l3.12,-3.12c0.29,-0.29 0.29,-0.75 0,-1.04L8.84,8zM8.47,6.37V3.36l1.5,1.5L8.47,6.37zM8.47,12.63V9.62l1.5,1.5L8.47,12.63zandroid:fillColor#FFFFFF//group/vector2. 修改PhoneStatusBarPolicy.java路径frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java方法updateBluetooth()修改前privatefinalvoidupdateBluetooth(){inticonIdR.drawable.stat_sys_data_bluetooth_connected;StringcontentDescriptionmResources.getString(R.string.accessibility_quick_settings_bluetooth_on);booleanbluetoothVisiblefalse;if(mBluetooth!null){// Bug 2687381, The Bluetooth icon is not displayed normally.Log.d(TAG,updateBluetooth(), mIsActive:mBluetooth.isBluetoothAudioActive());if(mBluetooth.isBluetoothConnected()(mBluetooth.isBluetoothAudioActive()||!mBluetooth.isBluetoothAudioProfileOnly())){contentDescriptionmResources.getString(R.string.accessibility_bluetooth_connected);bluetoothVisiblemBluetooth.isBluetoothEnabled();}}// ...}修改后privatefinalvoidupdateBluetooth(){// Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when open// int iconId R.drawable.stat_sys_data_bluetooth_connected;inticonIdR.drawable.stat_sys_data_bluetooth;StringcontentDescriptionmResources.getString(R.string.accessibility_quick_settings_bluetooth_on);booleanbluetoothVisiblefalse;if(mBluetooth!null){// Bug 2687381, The Bluetooth icon is not displayed normally.Log.d(TAG,updateBluetooth(), mIsActive:mBluetooth.isBluetoothAudioActive());// Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when openbluetoothVisiblemBluetooth.isBluetoothEnabled();if(mBluetooth.isBluetoothConnected()(mBluetooth.isBluetoothAudioActive()||!mBluetooth.isBluetoothAudioProfileOnly())){contentDescriptionmResources.getString(R.string.accessibility_bluetooth_connected);bluetoothVisiblemBluetooth.isBluetoothEnabled();// Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when openiconIdR.drawable.stat_sys_data_bluetooth_connected;}}// ...}修改点private final void updateBluetooth() { - int iconId R.drawable.stat_sys_data_bluetooth_connected; // Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when open // int iconId R.drawable.stat_sys_data_bluetooth_connected; int iconId R.drawable.stat_sys_data_bluetooth; String contentDescription mResources.getString(R.string.accessibility_quick_settings_bluetooth_on); boolean bluetoothVisible false; if (mBluetooth ! null) { // Bug 2687381, The Bluetooth icon is not displayed normally. Log.d(TAG, updateBluetooth(), mIsActive: mBluetooth.isBluetoothAudioActive()); // Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when open bluetoothVisible mBluetooth.isBluetoothEnabled(); if (mBluetooth.isBluetoothConnected() (mBluetooth.isBluetoothAudioActive() || !mBluetooth.isBluetoothAudioProfileOnly())) { contentDescription mResources.getString( R.string.accessibility_bluetooth_connected); bluetoothVisible mBluetooth.isBluetoothEnabled(); // Create by yeruilai 2026-6-6 19:54:14 Display Bluetooth icon when open iconId R.drawable.stat_sys_data_bluetooth_connected; } }附图

相关新闻

LangGraph原理逻辑-多智能体架构(一)

LangGraph原理逻辑-多智能体架构(一)

LangGraph的底层原理一、速了解LangGraph二、 LangGraph到底是干什么的?三、快速体验LangChain与LangGraph3.1. 代码对比 (基础)3.2. 代码对比 (添加工具)总结一、速了解LangGraph LangGraph是一个功能非常强大的大语言模型本地…

2026/7/21 8:37:02 阅读更多 →
TFRS工业级推荐系统实战:从双塔模型到业务可解释性

TFRS工业级推荐系统实战:从双塔模型到业务可解释性

1. 项目概述:这不是“调个库就完事”的推荐系统,而是用TFRS把业务逻辑焊进模型里的实战 如果你在搜索“TFRS 推荐系统”时,看到的全是几行代码跑通MovieLens数据集的教程,然后戛然而止——那你不是没找到答案,而是还没…

2026/7/21 8:37:02 阅读更多 →
间隙衰败引起的问题(F-Tile PMA/FEV Direct PHY IP 或Ultrascale FPGAs Transeivers Wizard(1.7))

间隙衰败引起的问题(F-Tile PMA/FEV Direct PHY IP 或Ultrascale FPGAs Transeivers Wizard(1.7))

间隙衰败引起的问题(BIT 或FEC ERR) 数据传输过程中出现bit err(quartusII)Auto Mode(自动模式)Manual Mode(手动模式)Native Mode(原生模式) 数据传输过程中出现FEC误报&#xff08…

2026/7/21 8:37:02 阅读更多 →

最新新闻

Claude Code接入DeepSeek API:低成本AI编程助手完整配置指南

Claude Code接入DeepSeek API:低成本AI编程助手完整配置指南

如果你正在寻找一种既能享受 Claude Code 强大编程助手功能,又能大幅降低使用成本的方法,那么将 Claude Code 接入 DeepSeek API 可能是当前最具性价比的选择。传统上,Claude Code 依赖 Anthropic 官方 API,费用相对较高&#xff…

2026/7/21 16:42:23 阅读更多 →
这几款AI教材编写工具,轻松解决高校专业教材编写难题

这几款AI教材编写工具,轻松解决高校专业教材编写难题

#AI写教材工具介绍 写教材的时候,选用什么工具真是一件令人头疼的事。用普通的办公软件,功能太简单,得一个步骤一个步骤自己去搭框架、调格式,费时又费力;想试试专业的教材编写软件,又发现操作复杂&#x…

2026/7/21 16:42:23 阅读更多 →
别再为论文发愁!2026年6款AI论文工具实测,一键生成优质大纲

别再为论文发愁!2026年6款AI论文工具实测,一键生成优质大纲

#AI论文写作软件介绍与常见问题解答 写期刊论文的时候,是不是经常被海量资料搞得头大?面对各种复杂的格式要求,还有不停的修改调整,效率总是上不去,很多科研人员都遇到过这样的难题。其实,现在有了AI论文助…

2026/7/21 16:42:23 阅读更多 →
jQuery.Flipster版本升级指南:从1.0到最新版的功能变化与迁移技巧

jQuery.Flipster版本升级指南:从1.0到最新版的功能变化与迁移技巧

jQuery.Flipster版本升级指南:从1.0到最新版的功能变化与迁移技巧 【免费下载链接】jquery-flipster Responsive, CSS3, touch-enabled jQuery Coverflow plugin. 项目地址: https://gitcode.com/gh_mirrors/jq/jquery-flipster jQuery.Flipster是一个响应式…

2026/7/21 16:42:23 阅读更多 →
2026超强盘点!8款AI论文工具深度测评,助你快速搞定毕业论文初稿

2026超强盘点!8款AI论文工具深度测评,助你快速搞定毕业论文初稿

#AI论文写作工具全方位测评 还在为了写期刊论文、毕业论文或者职称论文而感到头疼吗?当你准备自己动手写论文时,面对一大堆相关文献,找资料就像在大海里捞针一样,让人很不容易。再加上各种复杂的格式和写作要求,整个人…

2026/7/21 16:42:23 阅读更多 →
基于协同过滤推荐算法的云裳非物质文化商城平台

基于协同过滤推荐算法的云裳非物质文化商城平台

选题背景 随着数字化时代的快速发展,非物质文化遗产的保护与传承面临新的机遇与挑战。非物质文化遗产(以下简称“非遗”)作为中华优秀传统文化的重要组成部分,承载着丰富的历史记忆、文化内涵和民族精神。然而,许多非遗…

2026/7/21 16:41:22 阅读更多 →

日新闻

Octane Render与C4D汉化版安装与优化指南

Octane Render与C4D汉化版安装与优化指南

1. Octane Render与C4D的黄金组合:为什么选择这个方案?在三维创作领域,渲染器的选择往往决定了作品的最终呈现质量和工作效率。作为Cinema 4D(C4D)用户,Octane Render的GPU加速特性与实时预览功能&#xff…

2026/7/21 0:00:19 阅读更多 →
GPMC接口设计:异步/同步模式与多路复用配置实战

GPMC接口设计:异步/同步模式与多路复用配置实战

1. GPMC接口设计:从硬件连接到软件配置的全局视角在嵌入式系统开发中,尤其是基于TI Sitara系列如AM263x这类高性能微控制器的项目里,外部存储器的扩展几乎是绕不开的一环。无论是存放大量非易失性代码的NOR Flash,还是作为高速数据…

2026/7/21 0:00:19 阅读更多 →
UE5 GAS框架下RPG被动技能系统:从核心原理到实战实现

UE5 GAS框架下RPG被动技能系统:从核心原理到实战实现

1. 项目概述:UE5 GAS RPG被动技能的核心价值在UE5里用GAS(Gameplay Ability System)做RPG游戏,主动技能像是你手里的武器,按一下打一下,逻辑直接,反馈也快。但被动技能,它更像是你身…

2026/7/21 0:00:19 阅读更多 →

周新闻

Go语言静态资源打包方案对比与实践指南

Go语言静态资源打包方案对比与实践指南

1. 项目背景与核心需求在Go语言开发中,我们经常需要处理静态资源文件的打包问题。无论是Web应用的模板文件、前端资源,还是配置文件、证书等,都需要随程序一起分发。传统做法是将这些文件与编译后的二进制文件放在同一目录下,但这…

2026/7/21 8:48:31 阅读更多 →
Go语言实现高性能LDAP认证服务的架构与实践

Go语言实现高性能LDAP认证服务的架构与实践

1. 项目背景与核心价值LDAP(轻量级目录访问协议)作为企业级身份认证的黄金标准,已经服务了超过80%的财富500强公司。我在金融科技领域实施统一认证体系时,发现传统Java方案存在启动慢、内存占用高等痛点。而Go语言凭借其协程并发模…

2026/7/21 5:34:47 阅读更多 →
【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

更多请点击: https://intelliparadigm.com 第一章:AI面试官实战指南的核心价值与适用场景 AI面试官并非替代人类HR的“黑箱工具”,而是以可解释、可审计、可迭代的方式,赋能招聘全链路的关键基础设施。其核心价值在于将主观经验沉…

2026/7/21 8:25:39 阅读更多 →

月新闻