GetDialogSessionInfo修复抛错误码

Signed-off-by: lidongrui <lidongrui3@huawei.com>

Change-Id: I274df517c0f3570a9f83d93934f53b6eb5602b74
This commit is contained in:
lidongrui
2025-09-15 13:01:52 +08:00
parent beef63cf49
commit 768a0e293a
3 changed files with 3 additions and 2 deletions
@@ -74,6 +74,7 @@ private:
auto errcode = AbilityManagerClient::GetInstance()->GetDialogSessionInfo(dialogSessionId, dialogSessionInfo);
if (errcode || dialogSessionInfo == nullptr) {
TAG_LOGE(AAFwkTag::DIALOG, "GetDialogSessionInfo error");
ThrowErrorByNativeErr(env, errcode);
return CreateJsUndefined(env);
}
#endif // SUPPORT_SCREEN
@@ -3367,7 +3367,7 @@ int AbilityManagerStub::GetDialogSessionInfoInner(MessageParcel &data, MessagePa
int result = GetDialogSessionInfo(dialogSessionId, info);
if (result != ERR_OK || info == nullptr) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "not find dialogSessionInfo");
return ERR_INVALID_VALUE;
return result;
}
if (!reply.WriteParcelable(info)) {
return ERR_INVALID_VALUE;
@@ -2773,7 +2773,7 @@ HWTEST_F(AbilityManagerStubTest, AbilityManagerStub_GetDialogSessionInfoInner_00
MessageParcel data;
MessageParcel reply;
auto res = stub_->GetDialogSessionInfoInner(data, reply);
EXPECT_EQ(res, ERR_INVALID_VALUE);
EXPECT_EQ(res, NO_ERROR);
}
/*