文件最后提交记录最后更新时间
!2089 merge feat/hibernate-callback-optimize into master test: add unit tests for ISyncHibernateCallback death recipient and lock optimization Created-by: wangyantian0 Commit-by: wangyantian Merged-by: openharmony_ci Description: > 请检查PR是否满足[《代码合入流程指导和规范》](https://gitee.com/openharmony/powermgr_power_manager/wikis/issue-commit-pr-standard) , 否则将不会审查通过。 **【关联Issue】** https://gitcode.com/openharmony/powermgr_power_manager/issues/1690 **【修改描述】** **【验证结果】** See merge request: openharmony/powermgr_power_manager!20892 天前
feat: add displayId parameter to RunningLock interfaces for multi-display support Add uint64_t displayId parameter to RunningLock SCREEN type locks to support filtering by display in multi-display scenarios. Changes: - Add displayId field to RunningLockParam and RunningLockInfo structs - Update IDL interfaces with displayId parameter - Update all layers (client, service, adapter, manager) with displayId parameter - Add POWER_MANAGER_ENABLE_DISPLAY_ID_FILTERING feature flag in powermgr.gni - Filtering logic guarded by feature flag for SCREEN type locks only - Use std::multimap to allow multiple displayId registrations per client - Prevent duplicate registrations for same (callback, displayId) pair - Fix death recipient handling: only remove when no callbacks remain - Add RemoveAllRunningLockChangedCallbacks and HasRunningLockChangedCallbacks methods - Conditional logging: displayId shown only when feature enabled - Add NormalizeDisplayId helper to treat displayId as UINT64_MAX when feature OFF - Add displayId parameter to OnAsyncScreenRunningLockChanged callback - Implement per-displayId notification tracking for RUNNINGLOCK_SCREEN type - HandleScreenLockNotify: tracks locks per displayId, notifies on 0->1 or 1->0 transitions - UINT64_MAX locks broadcast to all registered displayIds - LockCounter simplified: no mgr_ pointer, notification logic moved to RunningLockMgr - Release screenLockCountMutex_ before sending notifications to reduce contention - UpdateUnSceneLockLists moved after Increase/Decrease succeeds Unit tests: - RunningLockNative047-053: Test displayId parameter handling - RunningLockNative054: Test duplicate registration prevention - RunningLockNative055: Test RemoveAllRunningLockChangedCallbacks - RunningLockNative056: Test per-displayId notification transitions (0->1, 1->0) - RunningLockNative057: Test UINT64_MAX lock broadcast (acquire) - RunningLockNative058: Test UINT64_MAX lock broadcast (release) - RunningLockNative059: Test mixed scenario (specific displayId + UINT64_MAX) - RunningLockNative060: Test multiple displayIds independent notification - Fix existing tests to pass correct displayId when unregistering - Update callback tests to include displayId parameter Co-Authored-By: Agent Signed-off-by: z30053694 <zhangchen190@h-partners.com> Change-Id: I4beb6f8272803572a3e944a768ec8d882766b0d9 14 天前
Apply PR review comments from GitCode PR #2100 Applied 5 review comments: - Comment 172844612: Remove -1 argument from FillRunningLockParam call - Comment 172848679: Rename PrepareLock to ValidateLockForEnable - Comment 172848869: Merge nested #ifdef to single #if defined(...) && defined(...) - Comment 172846360: Change sequential lock_guard to std::scoped_lock - Comment 172849112: Extract callback logic to RunningLockCallbackManager class Changes: - Removed unnecessary -1 argument in power_mgr_service.cpp - Renamed PrepareLock method to ValidateLockForEnable - Merged nested #ifdef blocks for consistency - Used std::scoped_lock for deadlock-safe multi-mutex locking - Extracted RunningLockCallbackManager class for better modularity - Added GetRunningLockChangedCallbackCount() for test visibility - Fixed pre-existing test bug in power_mgr_service_native_test.cpp Co-Authored-By: Agent Signed-off-by: z30053694 <zhangchen190@h-partners.com> Change-Id: I1c88bdfa7885a1714167fb411c4bb350ab201025 8 天前