diff --git a/BUILD.gn b/BUILD.gn index 2c6f02bc86bb54d58ee7eec96c3edf823ee534e5..57f6c7422a9537054bfd826b6e59e3e3ffd4030a 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", diff --git a/frameworks/src/bundle_active_group_observer.cpp b/frameworks/src/bundle_active_group_observer.cpp index 15aefc4b4752c71a0767459a2ee067753aff08d8..23eef00616df73d7d32dfbf266c64a44631ef3a5 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 37607d1c1bf322c1c6134de5bc7d2ff3375c8de5..28acc5335d9e2d7d564db173022dffac1ae95cb1 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; } }