| 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 天前 |