From 90a8ff787ed1c6e5c053b6e751740bd3a243bac8 Mon Sep 17 00:00:00 2001 From: kaiju Date: Wed, 30 Apr 2025 10:00:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:cancelauth=E8=BF=94=E5=9B=9E=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kaiju Change-Id: Icc86835e9353b9001ca6acd598fbee358a0f2a07 --- services/context/src/simple_auth_context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/context/src/simple_auth_context.cpp b/services/context/src/simple_auth_context.cpp index a2a9a1b65..a5919d8d5 100644 --- a/services/context/src/simple_auth_context.cpp +++ b/services/context/src/simple_auth_context.cpp @@ -31,6 +31,7 @@ namespace OHOS { namespace UserIam { namespace UserAuth { + constexpr int32_t RESULT_NOT_FOUND = VENDOR_ERROR_CODE_BEGIN + 0x6; std::optional> SimpleAuthContext::GetPropertyTemplateIds( Authentication::AuthResultInfo &resultInfo) { @@ -214,7 +215,11 @@ bool SimpleAuthContext::OnStop() bool cancelRet = auth_->Cancel(); if (!cancelRet) { IAM_LOGE("%{public}s auth stop fail", GetDescription()); - SetLatestError(auth_->GetLatestError()); + int32_t resultCode = auth_->GetLatestError(); + if (resultCode == RESULT_NOT_FOUND) { + resultCode = INVALID_CONTEXT_ID; + } + SetLatestError(resultCode); return cancelRet; } return true; -- Gitee From 4ed404c8092f81f9858c6fd1eb99b2602a74a99c Mon Sep 17 00:00:00 2001 From: kaiju Date: Wed, 30 Apr 2025 11:56:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E9=97=B4=E6=8E=A5=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E6=94=B9=E7=9B=B4=E6=8E=A5=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kaiju Change-Id: Idd6e91e9673752ba7614afaf941261b29d23b1b8 --- services/base/BUILD.gn | 1 + services/context/BUILD.gn | 1 + services/core/BUILD.gn | 1 + services/ipc/BUILD.gn | 1 + 4 files changed, 4 insertions(+) diff --git a/services/base/BUILD.gn b/services/base/BUILD.gn index c71140c50..c8bb87834 100644 --- a/services/base/BUILD.gn +++ b/services/base/BUILD.gn @@ -47,6 +47,7 @@ ohos_source_set("userauth_service_base") { "access_token:libaccesstoken_sdk", "c_utils:utils", "drivers_interface_user_auth:libuser_auth_proxy_3.0", + "hdf_core:libhdf_utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", diff --git a/services/context/BUILD.gn b/services/context/BUILD.gn index 7e1676d3f..45953159b 100644 --- a/services/context/BUILD.gn +++ b/services/context/BUILD.gn @@ -81,6 +81,7 @@ ohos_source_set("userauth_service_context") { "access_token:libaccesstoken_sdk", "c_utils:utils", "drivers_interface_user_auth:libuser_auth_proxy_3.0", + "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", diff --git a/services/core/BUILD.gn b/services/core/BUILD.gn index 628409b60..185cb305c 100644 --- a/services/core/BUILD.gn +++ b/services/core/BUILD.gn @@ -96,6 +96,7 @@ ohos_source_set("userauth_service_core") { "c_utils:utils", "device_manager:devicemanagersdk", "drivers_interface_user_auth:libuser_auth_proxy_3.0", + "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "hitrace:hitrace_meter", diff --git a/services/ipc/BUILD.gn b/services/ipc/BUILD.gn index e8b8affc7..848207599 100644 --- a/services/ipc/BUILD.gn +++ b/services/ipc/BUILD.gn @@ -65,6 +65,7 @@ ohos_source_set("userauth_services_ipc") { "device_manager:devicemanagersdk", "drivers_interface_user_auth:libuser_auth_proxy_3.0", "dsoftbus:softbus_client", + "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "hitrace:hitrace_meter", -- Gitee