Android 打开蓝牙状态栏显示蓝牙图标
程序员文章站
2022-06-22 09:53:55
系统默认是蓝牙链接后才在状态栏显示蓝牙图标现在修改为打开蓝牙就在状态栏显示蓝牙图标frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java private final void updateBluetooth() { int iconId = R.drawable.stat_sys_data_bluetooth_......
系统默认是蓝牙链接后才在状态栏显示蓝牙图标
现在修改为打开蓝牙就在状态栏显示蓝牙图标
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
private final void updateBluetooth() {
int iconId = R.drawable.stat_sys_data_bluetooth_connected;
String contentDescription =
mResources.getString(R.string.accessibility_quick_settings_bluetooth_on);
boolean bluetoothVisible = false;
if (mBluetooth != null) {
+ if(mBluetooth.isBluetoothEnabled()) {
+ bluetoothVisible = mBluetooth.isBluetoothEnabled();
+ }
if (mBluetooth.isBluetoothConnected()
&& (mBluetooth.isBluetoothAudioActive()
|| !mBluetooth.isBluetoothAudioProfileOnly())) {
contentDescription = mResources.getString(
R.string.accessibility_bluetooth_connected);
bluetoothVisible = mBluetooth.isBluetoothEnabled();
}
}
mIconController.setIcon(mSlotBluetooth, iconId, contentDescription);
mIconController.setIconVisibility(mSlotBluetooth, bluetoothVisible);
}
本文地址:https://blog.csdn.net/hmily0917/article/details/110525365
上一篇: MongoDB4.2.5安装方法操作步骤
下一篇: 学会Swagger,接口调试不再烦恼