!1066 UIExtension模系统弹框断连消息问题适配

Merge pull request !1066 from liuhanxiong/master
This commit is contained in:
openharmony_ci 2024-10-20 10:47:41 +00:00 committed by Gitee
commit 54f359b137
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 3 deletions

View File

@ -32,8 +32,6 @@ void UIExtensionAbilityConnection::OnAbilityConnectDone(const AppExecFwk::Elemen
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (!isConnectionRelease_) {
IAM_LOGE("connection already release");
ReleaseUIExtensionComponentInner();
WidgetClient::Instance().ForceStopAuth();
return;
}
if (remoteObject == nullptr) {
@ -69,7 +67,10 @@ void UIExtensionAbilityConnection::OnAbilityDisconnectDone(const AppExecFwk::Ele
IAM_LOGI("on ability disconnected");
std::lock_guard<std::recursive_mutex> lock(mutex_);
connectAbilityHitrace_ = nullptr;
ReleaseUIExtensionComponentInner();
if (!isConnectionRelease_) {
IAM_LOGE("connection already release");
return;
}
WidgetClient::Instance().ForceStopAuth();
}

View File

@ -477,6 +477,7 @@ bool WidgetContext::DisconnectExtension()
IAM_LOGE("invalid connection handle");
return false;
}
WidgetClient::Instance().ForceStopAuth();
connection_->ReleaseUIExtensionComponent();
ErrCode ret = AAFwk::ExtensionManagerClient::GetInstance().DisconnectAbility(connection_);
connection_ = nullptr;