Skip to content

Commit 110fc6f

Browse files
committed
fix: fix sound effect process exit and optimize bluetooth notifications
Fixed sound effect service not exiting properly during logout by adding systemd service configuration. Enhanced Bluetooth file transfer notifications to properly close previous notifications and use new notification IDs. The changes include: 1. Added SystemdService directive to D-Bus service file for proper service management 2. Created systemd user service unit file for sound effect service with proper session integration 3. Modified Bluetooth OBEX agent to close previous notifications before sending new ones 4. Changed notification ID handling to use 0 (new notification) instead of replaceID for better user experience Log: Improved Bluetooth file transfer notification behavior and fixed sound effect service lifecycle Influence: 1. Test Bluetooth file transfer notifications - they should properly replace old notifications 2. Verify sound effect service exits correctly during logout/reboot 3. Check that new Bluetooth transfer notifications appear correctly 4. Test system stability when multiple file transfers occur simultaneously 5. Verify sound effects work normally during regular usage fix: 修复音效进程退出问题并优化蓝牙通知 修复注销时音效进程未正确退出的问题,通过添加 systemd 服务配置。优化蓝牙 文件传输通知,正确关闭先前通知并使用新的通知ID。 具体修改包括: 1. 在 D-Bus 服务文件中添加 SystemdService 指令以实现正确的服务管理 2. 为音效服务创建 systemd 用户服务单元文件,实现正确的会话集成 3. 修改蓝牙 OBEX 代理,在发送新通知前正确关闭先前通知 4. 更改通知 ID 处理,使用 0(新通知)而非 replaceID 以提升用户体验 Log: 改进蓝牙文件传输通知行为并修复音效服务生命周期问题 PMS: BUG-334279 BUG-299605 Influence: 1. 测试蓝牙文件传输通知 - 应正确替换旧通知 2. 验证音效服务在注销/重启时正确退出 3. 检查新的蓝牙传输通知是否正确显示 4. 测试多个文件同时传输时的系统稳定性 5. 验证正常使用期间音效功能正常工作
1 parent 4ff3663 commit 110fc6f

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

bluetooth1/obex_agent.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,12 @@ func (a *obexAgent) notifyProgress(notify notifications.Notifications, replaceID
455455
logger.Warning("failed to send notify:", err)
456456
}
457457
} else {
458+
notify.CloseNotification(0, replaceID)
458459
actions = []string{"_view", gettext.Tr("View")}
459460
hints := map[string]dbus.Variant{"x-deepin-action-_view": dbus.MakeVariant("dde-file-manager,--show-item," + filename)}
460461
notifyID, err = notify.Notify(0,
461462
gettext.Tr("dde-control-center"),
462-
replaceID,
463+
0,
463464
notifyIconBluetoothConnected,
464465
fmt.Sprintf(gettext.Tr("You have received files from %q successfully"), device),
465466
gettext.Tr("Done"),
@@ -484,9 +485,10 @@ func (a *obexAgent) notifyFailed(notify notifications.Notifications, replaceID u
484485
body = gettext.Tr("Bluetooth connection failed")
485486
}
486487

488+
notify.CloseNotification(0, replaceID)
487489
notifyID, err := notify.Notify(0,
488490
gettext.Tr("dde-control-center"),
489-
replaceID,
491+
0,
490492
notifyIconBluetoothConnectFailed,
491493
summary,
492494
body,
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[D-BUS Service]
22
Name=org.deepin.dde.SoundEffect1
3-
Exec=/usr/lib/deepin-daemon/soundeffect
3+
Exec=/bin/false
4+
SystemdService=org.deepin.dde.SoundEffect1.service
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=Deepin Sound Effect Service
3+
RefuseManualStart=no
4+
RefuseManualStop=no
5+
CollectMode=inactive-or-failed
6+
7+
PartOf=graphical-session.target
8+
After=dbus.service
9+
10+
[Service]
11+
Type=dbus
12+
BusName=org.deepin.dde.SoundEffect1
13+
ExecStart=/usr/lib/deepin-daemon/soundeffect
14+
Slice=session.slice
15+
Restart=on-failure
16+
RestartSec=1s

0 commit comments

Comments
 (0)