提交 f5e6650b 编写于 作者: C chengjinsong2

test

Signed-off-by: Nchengjinsong2 <chengjinsong2@huawei.com>
Change-Id: I5de6433f09a4f9bc96065660169ecc115b9c53fc
上级 08d61990
......@@ -133,6 +133,7 @@ uint32_t WatcherManagerKits::GetRemoteWatcher(void)
WATCHER_CHECK(watcherManager != nullptr, return 0, "Failed to get watcher manager");
remoteWatcher_ = new RemoteWatcher(this);
WATCHER_CHECK(remoteWatcher_ != nullptr, return 0, "Failed to create watcher");
WATCHER_LOGE("CJ WatcherManagerKits::GetRemoteWatcher remoteWatcher_ addr is:%p", static_cast<void*>(remoteWatcher_));
remoteWatcherId_ = watcherManager->AddRemoteWatcher(getpid(), remoteWatcher_);
WATCHER_CHECK(remoteWatcherId_ != 0, return 0, "Failed to add watcher");
return remoteWatcherId_;
......@@ -197,6 +198,7 @@ int32_t WatcherManagerKits::DelWatcher(const std::string &keyPrefix, ParameterCh
if (watchers_.empty()) { // no watcher, so delete remote agent
watcherManager->DelRemoteWatcher(remoteWatcherId_);
remoteWatcherId_ = 0;
WATCHER_LOGE("CJ WatcherManagerKits::DelWatcher remoteWatcher_ addr is:%p", static_cast<void*>(remoteWatcher_));
remoteWatcher_ = nullptr;
}
}
......
......@@ -21,6 +21,7 @@ namespace init_param {
uint32_t WatcherManagerProxy::AddRemoteWatcher(uint32_t id, const sptr<IWatcher> &watcher)
{
WATCHER_CHECK(watcher != nullptr, return ERR_INVALID_VALUE, "Invalid param");
WATCHER_LOGE("CJ WatcherManagerProxy::AddRemoteWatcher watcher addr is:%p", static_cast<void*>(watcher));
MessageParcel data;
data.WriteInterfaceToken(WatcherManagerProxy::GetDescriptor());
bool ret = data.WriteRemoteObject(watcher->AsObject());
......
......@@ -164,6 +164,7 @@ void WatcherGroup::ProcessParameterChange(
// walk watcher
TraversalNode([this, mananger, name, value](ParamWatcherListPtr list, WatcherNodePtr node, uint32_t index) {
auto remoteWatcher = mananger->GetRemoteWatcher(node->GetNodeId());
WATCHER_LOGE("CJ mananger->GetRemoteWatcher remoteWatcher is:%p", static_cast<void*>(remoteWatcher));
if (remoteWatcher == nullptr) {
return;
}
......@@ -509,6 +510,7 @@ void WatcherManager::Clear(void)
list->RemoveNode(node);
auto remoteWatcher = ConvertTo<RemoteWatcher>(node);
WATCHER_LOGV("Delete remote watcher %u", remoteWatcher->GetRemoteWatcherId());
WATCHER_LOGE("CJ WatcherManager::Clear remoteWatcher");
delete remoteWatcher;
});
delete remoteWatchers_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册