| fix(ans): fix heap-use-after-free in singleton DCLP and notificationList_ race 1. NotificationPreferences::GetInstance() and SystemSoundHelper::GetInstance(): replace broken DCLP with Meyer's singleton (C++11 thread-safe static local). The DCLP had unprotected shared_ptr reads causing data race when static instance_ was destroyed during process exit while ffrt worker threads called GetInstance(). 2. ClearRingtoneByApplication / ClearOverTimeRingToneInfo: - Remove 5-second delay (DEL_TASK_DELAY) from Submit calls. The delay caused SelfClean()'s drain to not wait for delayed tasks, leaving them pending after process exit. - Remove redundant std::bind wrapper, pass lambda directly. - Use Submit(func) without delay parameter. 3. serviceprivateutilsa_fuzzer: wrap direct DeleteAllByUserStopped() call with notificationSvrQueue_.SyncSubmit() to serialize with async tasks from OnUserRemoved/OnUserStopped, preventing concurrent read/write race on notificationList_ (list iterator use-after-free). 4. Fix empty if block in mock_ans_rdb_mgr_builder.cpp (cpplint). Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I8197f195c73f6cf2ea90e5a68c2afdea00d73ac0 | 3 天前 |