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/10/16 8:41:11 阅读更多 →
TFRS工业级推荐系统实战:从双塔模型到业务可解释性

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

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

2026/10/16 15:41:10 阅读更多 →
间隙衰败引起的问题(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/10/16 17:18:44 阅读更多 →

最新新闻

Python爬虫实战:从网页剖析到数据落库的完整路径

Python爬虫实战:从网页剖析到数据落库的完整路径

简介:Python网络数据抓取代码是一份面向Python初学者的爬虫与数据采集实践包,适合数据分析师、数据科学家、机器学习与自然语言处理方向入门者自学,也可用于网站内容采集、电商信息监控、舆情监测、市场调研等典型任务。资源围绕网络请求、页…

2026/10/16 21:58:15 阅读更多 →
Linux防火墙完全配置指南:iptables、firewalld与ufw详解

Linux防火墙完全配置指南:iptables、firewalld与ufw详解

1. 为什么Linux服务器需要防火墙:先弄清楚它在挡什么先讲一个我实际遇到过的场景。某开发者给公司内部部署了一套应用,把服务跑在8080端口,自以为端口开了就万事大吉。结果第二天用户反馈访问不了——排查到最后才发现,云厂商安全…

2026/10/16 21:58:15 阅读更多 →
信息学奥赛课课通C++配套资料:用好测试数据从不浪费题库

信息学奥赛课课通C++配套资料:用好测试数据从不浪费题库

简介:《信息学奥赛课课通(C)》完整配套资料包,面向准备参加信息学竞赛(NOIP、CSP等)的中学生和C初学者,内容系统覆盖C语法基础、STL容器、面向对象编程及搜索排序等竞赛常考算法。整个rar压缩包…

2026/10/16 21:58:15 阅读更多 →
Cesium 入门指南:从三维地球到 WebGIS 开发的完整教程

Cesium 入门指南:从三维地球到 WebGIS 开发的完整教程

简介:面向具备一定Web前端基础、希望入门三维地球开发的技术人员,这份Cesium学习教程PPT以入门级教学为核心,系统梳理了从开发环境搭建到核心API应用的全流程,可帮助开发团队快速搭建虚拟地球Web应用。内容从Node、VSCode、Nginx等…

2026/10/16 21:58:15 阅读更多 →
Logistic回归二分类实验全复盘:从原理推导到PyTorch实现

Logistic回归二分类实验全复盘:从原理推导到PyTorch实现

实验三的任务是logistic回归预测二分类。说实话,刚开始我有点看不上这个实验,毕竟周围同学已经开始讨论各种“网络结构”了,而我还在跟一条S曲线打交道。但真正把代码跑起来、把loss曲线拉出来看之后,我的想法完全变了。这个实验表…

2026/10/16 21:58:15 阅读更多 →
TurboVLA 0.2B模型如何实现32Hz实时推理与0.9GB显存优化

TurboVLA 0.2B模型如何实现32Hz实时推理与0.9GB显存优化

1. TurboVLA 到底解决了什么问题第一次看到“0.2B 参数、32Hz 实时推理、RTX 4090 只占 0.9GB 显存”这组数字,我的反应是:这要么是标题党,要么是在某个特定任务上做了极致裁剪。因为按常规经验,一个 0.2B 的模型想在消费级卡上跑…

2026/10/16 21:57:14 阅读更多 →

日新闻

个人 AI Agent 平台接入 TaoToken:统一 Key 与 API 通道的配置大纲

个人 AI Agent 平台接入 TaoToken:统一 Key 与 API 通道的配置大纲

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 0:00:05 阅读更多 →
信号与系统频域分析作业解题指南

信号与系统频域分析作业解题指南

1. 作业背景与核心要求解析信号与系统作为电子信息类专业的核心基础课,其作业设计往往直接关联课程的核心知识框架。2026年春季第六次作业的布置,通常对应着课程进展到频域分析的关键阶段。根据常规教学进度推测,本次作业可能涉及以下核心内容…

2026/10/16 0:00:05 阅读更多 →
Django MVT实战:从零构建图书借阅系统,彻底搞懂Model-View-Template分层

Django MVT实战:从零构建图书借阅系统,彻底搞懂Model-View-Template分层

1. 从一个"四不像"的练手项目说起如果你已经看完了Django的官方教程前几章,跟着敲完了投票应用,大概会有一种"我好像会了,又好像什么都不会"的割裂感。教程里每个知识点都是拆开的——这一章讲模型,下一章讲视…

2026/10/16 0:00:05 阅读更多 →

周新闻

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

简介:基于 ARIMA、LSTM、Transformer 等模型的流感时间序列预测 Python 源码,面向计算机相关专业课程设计与期末大作业学生,以及项目实战学习者。内容覆盖预处理、平稳性检验、定阶、残差分析、多模型对比预测的完整时序建模流程,…

2026/10/16 21:35:51 阅读更多 →
影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别 做影刀RPA自动化,十个新手有八个栽在"往输入框里填东西"这件事上:要么填不进去,要么填了一半,要么直接把原来内容追加在后面。这背后的根因&…

2026/10/15 19:41:51 阅读更多 →
影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容 1. 认识影刀:什么场景该用RPA采小说数据 起点中文网的页面结构相对稳定——分类榜单、书籍详情、章节内容三块独立页面,跳转链路清晰。这种场景非常适合影刀自动化&#x…

2026/10/16 15:04:24 阅读更多 →

月新闻

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 21:54:38 阅读更多 →
Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 3:49:43 阅读更多 →
黑夜航拍船只数据集训练YOLOV5模型全流程解析

黑夜航拍船只数据集训练YOLOV5模型全流程解析

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 14:23:36 阅读更多 →