From 1955029956a6ac43ba5c11a731f3dac618407a16 Mon Sep 17 00:00:00 2001 From: Robertkill Date: Mon, 9 Mar 2026 15:33:00 +0800 Subject: [PATCH] fix(bluetooth): prevent toggling bluetooth power state in airplane mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a check in BluetoothItem::invokeMenuItem to block shifting the bluetooth power state if airplane mode is currently enabled. This prevents the background daemon from persisting the power-on state while the hardware/software rfkill is active, which causes bluetooth to be enabled unexpectedly after a relogin. Log: Prevent toggling bluetooth power state in airplane mode Influence: 1. Open the quick panel and enable airplane mode 2. Click the bluetooth toggle switch 3. Log out and log back in 4. Verify the bluetooth switch remains disabled in the quick panel fix(bluetooth): 修复在飞行模式下仍能切换蓝牙电源状态的问题 在 BluetoothItem::invokeMenuItem 中添加检查,如果当前已开启 飞行模式,则拒绝切换蓝牙电源状态的执行。这防止了在 rfkill 锁定期间,后台服务错误地将开启状态持久化配置,从而导致用户注销 重登后蓝牙被意外开启。 Log: 修复在飞行模式下仍能切换蓝牙电源状态的问题 Influence: 1. 打开快捷面板并开启飞行模式 2. 点击蓝牙开关图标进行切换 3. 注销并重新登录系统 4. 验证快捷面板中蓝牙开关依然保持关闭状态 PMS: BUG-352161 --- plugins/dde-dock/bluetooth/bluetoothitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/dde-dock/bluetooth/bluetoothitem.cpp b/plugins/dde-dock/bluetooth/bluetoothitem.cpp index 6cf98dcdf..22ddb911b 100644 --- a/plugins/dde-dock/bluetooth/bluetoothitem.cpp +++ b/plugins/dde-dock/bluetooth/bluetoothitem.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2016 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -121,6 +121,9 @@ void BluetoothItem::invokeMenuItem(const QString menuId, const bool checked) Q_UNUSED(checked); if (menuId == SHIFT) { + if (m_applet->airplaneModeEnable()) { + return; + } m_applet->setAdapterPowered(!m_adapterPowered); } else if (menuId == SETTINGS) { DDBusSender()