From 86f85874d7d29ca9981b32390bcf00327d2d694a Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Thu, 1 Sep 2022 20:32:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- BUILD.gn | 5 ----- 1 file changed, 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 2c6f02b..57f6c74 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -86,8 +86,6 @@ ohos_shared_library("bundlestate") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "napi:ace_napi", - "safwk:system_ability_fwk", - "samgr:samgr_proxy", ] relative_install_dir = "module" part_name = "${device_usage_statistics_part_name}" @@ -142,14 +140,11 @@ ohos_shared_library("usagestatservice") { ] external_deps = [ - "ability_base:configuration", "ability_base:want", "ability_runtime:app_manager", - "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "background_task_mgr:bgtaskmgr_innerkits", "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", -- Gitee From f56c23ba7e169f5c50ab3aa835d0c45a902b83fb Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Fri, 2 Sep 2022 10:49:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?codecheck=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- frameworks/src/bundle_active_group_observer.cpp | 4 ++-- services/common/src/bundle_active_service.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frameworks/src/bundle_active_group_observer.cpp b/frameworks/src/bundle_active_group_observer.cpp index 15aefc4..23eef00 100644 --- a/frameworks/src/bundle_active_group_observer.cpp +++ b/frameworks/src/bundle_active_group_observer.cpp @@ -224,7 +224,7 @@ napi_value RegisterGroupCallBack(napi_env env, napi_callback_info info) RegisterCallbackInfo params; AsyncRegisterCallbackInfo *asyncCallbackInfo = nullptr; ParseRegisterGroupCallBackParameters(env, info, params, asyncCallbackInfo); - if (params.errorCode != ERR_OK) { + if (params.errorCode != ERR_OK && !asyncCallbackInfo) { return BundleStateCommon::JSParaError(env, params.callback, params.errorCode); } std::unique_ptr callbackPtr {asyncCallbackInfo}; @@ -296,7 +296,7 @@ napi_value UnRegisterGroupCallBack(napi_env env, napi_callback_info info) UnRegisterCallbackInfo params; AsyncUnRegisterCallbackInfo *asyncCallbackInfo = nullptr; ParseUnRegisterGroupCallBackParameters(env, info, params, asyncCallbackInfo); - if (params.errorCode != ERR_OK) { + if (params.errorCode != ERR_OK && !asyncCallbackInfo) { return BundleStateCommon::JSParaError(env, params.callback, params.errorCode); } std::unique_ptr callbackPtr {asyncCallbackInfo}; diff --git a/services/common/src/bundle_active_service.cpp b/services/common/src/bundle_active_service.cpp index 37607d1..28acc53 100644 --- a/services/common/src/bundle_active_service.cpp +++ b/services/common/src/bundle_active_service.cpp @@ -378,7 +378,6 @@ int32_t BundleActiveService::SetBundleGroup(const std::string& bundleName, int32 if (userId == -1) { OHOS::ErrCode ret = BundleActiveAccountHelper::GetUserId(callingUid, userId); if (ret != ERR_OK) { - errCode = -1; return result; } isFlush = true; @@ -464,7 +463,6 @@ int32_t BundleActiveService::QueryPackageGroup(std::string& bundleName, int32_t if (userId == -1) { OHOS::ErrCode ret = BundleActiveAccountHelper::GetUserId(callingUid, userId); if (ret != ERR_OK) { - errCode = -1; return result; } } -- Gitee From 806cc36b21c660845a2a64e911f59547a79e2754 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Fri, 2 Sep 2022 10:52:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?codecheck=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- BUILD.gn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 57f6c74..2c6f02b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -86,6 +86,8 @@ ohos_shared_library("bundlestate") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "napi:ace_napi", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", ] relative_install_dir = "module" part_name = "${device_usage_statistics_part_name}" @@ -140,11 +142,14 @@ ohos_shared_library("usagestatservice") { ] external_deps = [ + "ability_base:configuration", "ability_base:want", "ability_runtime:app_manager", + "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "background_task_mgr:bgtaskmgr_innerkits", "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", -- Gitee