!1112 修改无障碍aa、asac服务启动未添加死亡回调

Merge pull request !1112 from qianchuang/add_death
This commit is contained in:
openharmony_ci 2024-05-26 01:59:03 +00:00 committed by Gitee
commit 903dfc40b5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 20 additions and 2 deletions

View File

@ -167,6 +167,15 @@ void AccessibleAbilityClientImpl::LoadSystemAbilitySuccess(const sptr<IRemoteObj
std::lock_guard<std::mutex> lock(conVarMutex_);
if (remoteObject != nullptr) {
serviceProxy_ = iface_cast<IAccessibleAbilityManagerService>(remoteObject);
if (!deathRecipient_) {
deathRecipient_ = new(std::nothrow) AccessibilityServiceDeathRecipient(*this);
if (!deathRecipient_) {
HILOG_ERROR("create deathRecipient_ fail.");
}
}
if (deathRecipient_ && remoteObject->IsProxyObject() && remoteObject->AddDeathRecipient(deathRecipient_)) {
HILOG_INFO("successed to add death recipient");
}
} else {
HILOG_WARN("remoteObject is nullptr.");
}

View File

@ -154,8 +154,8 @@ void AccessibilityConfig::Impl::LoadSystemAbilitySuccess(const sptr<IRemoteObjec
HILOG_ERROR("create deathRecipient_ fail.");
}
}
if (remoteObject->IsProxyObject() && remoteObject->AddDeathRecipient(deathRecipient_)) {
HILOG_DEBUG("successed to add death recipient");
if (deathRecipient_ && remoteObject->IsProxyObject() && remoteObject->AddDeathRecipient(deathRecipient_)) {
HILOG_INFO("successed to add death recipient");
}
} else {
HILOG_WARN("remoteObject is nullptr.");

View File

@ -136,6 +136,15 @@ void AccessibilitySystemAbilityClientImpl::LoadSystemAbilitySuccess(const sptr<I
std::lock_guard<std::mutex> lock(conVarMutex_);
if (remoteObject != nullptr) {
serviceProxy_ = iface_cast<IAccessibleAbilityManagerService>(remoteObject);
if (!deathRecipient_) {
deathRecipient_ = new(std::nothrow) DeathRecipient(*this);
if (!deathRecipient_) {
HILOG_ERROR("create deathRecipient_ fail.");
}
}
if (deathRecipient_ && remoteObject->IsProxyObject() && remoteObject->AddDeathRecipient(deathRecipient_)) {
HILOG_INFO("successed to add death recipient");
}
} else {
HILOG_WARN("remoteObject is nullptr.");
}