| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
!4960 merge fix/mst-db-isolation into master fix(ans): fix cross-SO singleton issue by adding AnsNotification::GetInstance() Created-by: cheerful_ricky Commit-by: CheerfulRicky Merged-by: openharmony_ci Description: ## Problem DelayedSingleton<AnsNotification>::GetInstance() returns different singleton objects in different shared libraries because the template's static members (instance_, mutex_) have vague linkage (COMDAT) and are hidden per-SO by -fvisibility=hidden + version scripts. ## Solution 1. **Add AnsNotification::GetInstance()** using function-local static (C++11 thread-safe, defined out-of-line in ans_notification.cpp within libans_innerkits, symbol exported via *Ans* in .map) 2. **Replace ALL callers** (NAPI/ANI/Tools/Tests/CJ FFI) from DelayedSingleton<AnsNotification>::GetInstance() to AnsNotification::GetInstance() 3. **Clean up** #include singleton.h from files that no longer use DelayedSingleton (kept in ans_manager_death_recipient.h and pixelmap_cache_manager.h which still use DelayedSingleton as base class) ## Why it works The function-local static in ans_notification.cpp lives in libans_innerkits.so's data segment. AnsNotification::GetInstance() is a non-inline member function compiled only in libans_innerkits.so and exported via *Ans* pattern in libans_innerkits.map. All SOs call this exported function through dynamic linking, sharing the single instance. ## Verification Syntax-checked key files with exact ninja build flags: ans_notification.cpp, notification_helper.cpp, ans_manager_death_recipient.cpp, napi_cancel.cpp, ani_cance.cpp, notification_manager_impl.cpp (CJ FFI), notification_shell_command.cpp (Tools) — all passed. Co-Authored-By: Agent See merge request: openharmony/notification_distributed_notification_service!4960 | 1 个月前 | |
输入不足告警整改 Signed-off-by: g00586423 <guxiang11@huawei.com> | 1 个月前 | |
fix(test): auto-isolate all test RDB via ans_service_sources_test wrapper Add ans_service_sources_test (ohos_static_library, testonly) that wraps ans_service_sources and automatically provides the mock_ans_rdb_mgr_builder strong override (isolated temp DB). All test targets now depend on ans_service_sources_test instead of ans_service_sources, so new test suites automatically get RDB isolation without manual changes. ans_service_sources_test_config propagates all needed include paths (ans headers, rdb headers, mock headers) to test targets. The mock source (mock_ans_rdb_mgr_builder.cpp) is compiled once into the static lib, avoiding include-path propagation issues with source_set recompilation. Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: Ieafd58f9f1e1433e3381c89a8c105f7191662986 Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> | 1 个月前 | |
cli服务化改造 Co-Authored-By:Agent Signed-off-by: xdongs2009 <xdongs@163.com> | 3 个月前 |