From 017d00da6fc37e7709b394910725d2746fdd2b01 Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 14 Sep 2026 18:57:39 +0800 Subject: [PATCH] fix: add missing audio-avrcp-target icon mapping for bluetooth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: deviceType2Icon map lacked the "audio-avrcp-target" entry introduced by BlueZ 5.85, causing AVRCP-capable bluetooth audio devices to show bluetooth_other instead of bluetooth_pheadset 2. Fix: add {"audio-avrcp-target", "pheadset"} to the map, and change QMap::operator[] to .value(key, "other") so unmapped icon strings fall back to "other" instead of an empty string 3. Impact: bluetooth audio devices with AVRCP profile now display the correct headset icon; all other device types unaffected Log: Fixed bluetooth audio device icon showing as unknown when device supports AVRCP profile Influence: 1. Test bluetooth headset/speaker with AVRCP profile shows correct icon 2. Test common bluetooth devices (keyboard, mouse, phone) show correct icons 3. Verify unmapped device types fall back to default icon fix: 补充蓝牙音频设备 audio-avrcp-target 图标映射 1. 根因:deviceType2Icon 映射表缺少 BlueZ 5.85 引入的 "audio-avrcp-target" 条目,导致支持 AVRCP 配置文件的蓝牙音频 设备显示 bluetooth_other 而非 bluetooth_pheadset 2. 方案:在映射表中添加 {"audio-avrcp-target", "pheadset"} 条目, 并将 QMap::operator[] 改为 .value(key, "other"),使未映射的 图标字符串回退到 "other" 而非空字符串 3. 影响:支持 AVRCP 配置文件的蓝牙音频设备现在显示正确的耳机 图标,其他设备类型不受影响 Log: 修复支持 AVRCP 配置文件的蓝牙音频设备图标显示为未知的问题 Influence: 1. 测试支持 AVRCP 配置文件的蓝牙耳机/音箱显示正确图标 2. 测试常见蓝牙设备(键盘、鼠标、手机)图标显示无回归 3. 验证未映射设备类型回退到默认图标 PMS: BUG-324977 --- plugins/dde-dock/bluetooth/componments/device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dde-dock/bluetooth/componments/device.cpp b/plugins/dde-dock/bluetooth/componments/device.cpp index 520b18b2e..4496282c2 100644 --- a/plugins/dde-dock/bluetooth/componments/device.cpp +++ b/plugins/dde-dock/bluetooth/componments/device.cpp @@ -19,6 +19,7 @@ QMap Device::deviceType2Icon = { {"input-gaming", "other"}, {"input-tablet", "touchpad"}, {"audio-card", "pheadset"}, + {"audio-avrcp-target", "pheadset"}, {"network-wireless", "lan"}, {"camera-video", "vidicon"}, {"printer", "print"}, @@ -103,7 +104,7 @@ void Device::setRssi(int rssi) void Device::setDeviceType(const QString &deviceType) { - m_deviceType = deviceType2Icon[deviceType]; + m_deviceType = deviceType2Icon.value(deviceType, "other"); } QDebug &operator<<(QDebug &stream, const Device *device)