fix: fix sound effect process exit and optimize bluetooth notifications#1024
fix: fix sound effect process exit and optimize bluetooth notifications#1024fly602 merged 1 commit intolinuxdeepin:masterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideImplements proper systemd-based lifecycle management for the sound effect D-Bus service and refines Bluetooth OBEX file-transfer notifications to close previous notifications and always create fresh ones instead of reusing IDs. Sequence diagram for updated Bluetooth transfer notification behaviorsequenceDiagram
actor User
participant Device as RemoteDevice
participant ObexAgent as ObexAgent
participant Notify as NotificationsService
User->>Device: Initiate Bluetooth file transfer
Device->>ObexAgent: OBEX transfer events
rect rgb(235, 245, 255)
Note over ObexAgent: On transfer progress/completion
ObexAgent->>Notify: CloseNotification(0, oldNotifyID)
ObexAgent->>Notify: Notify(appID=0, appName=dde-control-center, replacesID=0, icon=notifyIconBluetoothConnected, summary, body, actions, hints)
Notify-->>ObexAgent: newNotifyID
end
rect rgb(255, 235, 235)
Note over ObexAgent: On transfer failure
ObexAgent->>Notify: CloseNotification(0, oldNotifyID)
ObexAgent->>Notify: Notify(appID=0, appName=dde-control-center, replacesID=0, icon=notifyIconBluetoothConnectFailed, summary, body, actions, hints)
Notify-->>ObexAgent: failureNotifyID
end
Notify-->>User: Fresh notification shown for each result
State diagram for SoundEffect1 service lifecycle with systemd managementstateDiagram-v2
[*] --> Inactive
Inactive --> Activating: D-Bus Name Requested
Activating --> Active: systemd starts SoundEffect1 service
Active --> Stopping: Session logout or reboot
Stopping --> Inactive: systemd stops SoundEffect1 service
Active --> Inactive: No clients and idle timeout (if configured)
Inactive --> [*]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In both
notifyProgressandnotifyFailed, consider guardingCloseNotificationwith areplaceID != 0check and handling/logging any error it returns so you don't make a D-Bus call for the default zero ID or silently ignore failures. - The change from using
replaceIDinNotifyto always passing0will cause every transfer to create a new notification; if the intent is to avoid duplicates while still updating existing toasts, you may want to revisit whether a per-transfer ID or tag can be used instead of completely disabling replacement.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In both `notifyProgress` and `notifyFailed`, consider guarding `CloseNotification` with a `replaceID != 0` check and handling/logging any error it returns so you don't make a D-Bus call for the default zero ID or silently ignore failures.
- The change from using `replaceID` in `Notify` to always passing `0` will cause every transfer to create a new notification; if the intent is to avoid duplicates while still updating existing toasts, you may want to revisit whether a per-transfer ID or tag can be used instead of completely disabling replacement.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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. 验证正常使用期间音效功能正常工作
5b30701 to
b4c2704
Compare
deepin pr auto review这段代码 diff 包含了蓝牙传输通知逻辑的修改和 SoundEffect 服务的 systemd 集成方式的变更。以下是对这两部分内容的详细审查和改进建议: 1. 蓝牙通知逻辑修改 (
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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:
Log: Improved Bluetooth file transfer notification behavior and fixed sound effect service lifecycle
Influence:
fix: 修复音效进程退出问题并优化蓝牙通知
修复注销时音效进程未正确退出的问题,通过添加 systemd 服务配置。优化蓝牙
文件传输通知,正确关闭先前通知并使用新的通知ID。
具体修改包括:
Log: 改进蓝牙文件传输通知行为并修复音效服务生命周期问题
PMS: BUG-334279 BUG-299605
Influence:
Summary by Sourcery
Improve lifecycle management of the sound effect service and refine Bluetooth file transfer notification behavior.
Bug Fixes:
Enhancements: