From f383d5e6b68164b7a7e98dc6c6652844c5bb3fc0 Mon Sep 17 00:00:00 2001 From: liwuli Date: Wed, 18 Jan 2023 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=81=A2=E5=A4=8D=E5=87=BA?= =?UTF-8?q?=E5=8E=82=E8=AE=BE=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liwuli --- bundle.json | 2 + etc/init/edm.cfg | 2 +- interfaces/inner_api/BUILD.gn | 2 + .../inner_api/common/include/policy_info.h | 1 + .../src/enterprise_device_mgr_proxy.cpp | 2 +- .../include/device_control_proxy.h | 36 +++++++ .../src/device_control_proxy.cpp | 58 ++++++++++++ interfaces/kits/device_control/BUILD.gn | 47 ++++++++++ .../include/device_control_addon.h | 49 ++++++++++ .../src/device_control_addon.cpp | 94 +++++++++++++++++++ services/edm/include/permission_manager.h | 3 +- services/edm_plugin/BUILD.gn | 13 +++ .../edm_plugin/include/reset_factory_plugin.h | 33 +++++++ .../edm_plugin/src/reset_factory_plugin.cpp | 47 ++++++++++ 14 files changed, 386 insertions(+), 3 deletions(-) create mode 100644 interfaces/inner_api/device_control/include/device_control_proxy.h create mode 100644 interfaces/inner_api/device_control/src/device_control_proxy.cpp create mode 100644 interfaces/kits/device_control/BUILD.gn create mode 100644 interfaces/kits/device_control/include/device_control_addon.h create mode 100644 interfaces/kits/device_control/src/device_control_addon.cpp create mode 100644 services/edm_plugin/include/reset_factory_plugin.h create mode 100644 services/edm_plugin/src/reset_factory_plugin.cpp diff --git a/bundle.json b/bundle.json index 7b11858eb..3eb95d1a4 100644 --- a/bundle.json +++ b/bundle.json @@ -83,6 +83,7 @@ "//base/customization/enterprise_device_management/interfaces/kits/admin_manager:adminmanager", "//base/customization/enterprise_device_management/interfaces/kits/datetime_manager:datetimemanager", "//base/customization/enterprise_device_management/interfaces/kits/device_info:deviceinfo", + "//base/customization/enterprise_device_management/interfaces/kits/device_control:devicecontrol", "//base/customization/enterprise_device_management/framework/extension:enterprise_admin_extension", "//base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension:enterpriseadminextensionability_napi", "//base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension_context:enterpriseadminextensioncontext_napi", @@ -93,6 +94,7 @@ "//base/customization/enterprise_device_management/services/edm:edmservice", "//base/customization/enterprise_device_management/services/edm_plugin:datetime_manager_plugin", "//base/customization/enterprise_device_management/services/edm_plugin:device_info_plugin", + "//base/customization/enterprise_device_management/services/edm_plugin:reset_factory_plugin", "//base/customization/enterprise_device_management/sa_profile:edm_sa_profile", "//base/customization/enterprise_device_management/etc/init:edm.cfg" ] diff --git a/etc/init/edm.cfg b/etc/init/edm.cfg index bdd59ed6a..2bc8912dc 100644 --- a/etc/init/edm.cfg +++ b/etc/init/edm.cfg @@ -15,7 +15,7 @@ "uid" : "edm", "gid" : ["edm", "shell"], "apl" : "system_core", - "permission" : ["ohos.permission.SET_TIME"], + "permission" : ["ohos.permission.SET_TIME", "ohos.permission.FACTORY_RESET"], "secon" : "u:r:edm_sa:s0" } ] diff --git a/interfaces/inner_api/BUILD.gn b/interfaces/inner_api/BUILD.gn index 00e723071..8da7ddc53 100644 --- a/interfaces/inner_api/BUILD.gn +++ b/interfaces/inner_api/BUILD.gn @@ -19,6 +19,7 @@ SRC_PATH = "$EDM_INNERKITS_PATH/" config("edmservice_kits_config") { include_dirs = [ "common/include", + "device_control/include", "device_info/include", "datetime_manager/include", "$SUBSYSTEM_DIR/common/native/include", @@ -32,6 +33,7 @@ ohos_shared_library("edmservice_kits") { "$SRC_PATH/common/src/ent_info.cpp", "$SRC_PATH/common/src/enterprise_device_mgr_proxy.cpp", "$SRC_PATH/datetime_manager/src/datetime_manager_proxy.cpp", + "$SRC_PATH/device_control/src/device_control_proxy.cpp", "$SRC_PATH/device_info/src/device_info_proxy.cpp", "$SUBSYSTEM_DIR/common/native/src/edm_sys_manager.cpp", ] diff --git a/interfaces/inner_api/common/include/policy_info.h b/interfaces/inner_api/common/include/policy_info.h index 573c4725b..16c619c1b 100644 --- a/interfaces/inner_api/common/include/policy_info.h +++ b/interfaces/inner_api/common/include/policy_info.h @@ -26,6 +26,7 @@ enum { GET_DEVICE_SERIAL = 1002, GET_DISPLAY_VERSION = 1003, GET_DEVICE_NAME = 1004, + RESET_FACTORY = 1005, }; #define POLICY_CODE_TO_NAME(ENUM_CODE, POLICY_NAME) do { \ diff --git a/interfaces/inner_api/common/src/enterprise_device_mgr_proxy.cpp b/interfaces/inner_api/common/src/enterprise_device_mgr_proxy.cpp index 9b4b7ec1f..133390747 100644 --- a/interfaces/inner_api/common/src/enterprise_device_mgr_proxy.cpp +++ b/interfaces/inner_api/common/src/enterprise_device_mgr_proxy.cpp @@ -292,7 +292,7 @@ ErrCode EnterpriseDeviceMgrProxy::IsAdminEnabled(AppExecFwk::ElementName &admin, } int32_t resCode = ERR_OK; if (!reply.ReadInt32(resCode) || FAILED(resCode)) { - EDMLOGW("EnterpriseDeviceMgrProxy:SetEnterpriseInfo get result code fail. %{public}d", resCode); + EDMLOGW("EnterpriseDeviceMgrProxy:IsAdminEnabled get result code fail. %{public}d", resCode); return resCode; } reply.ReadBool(result); diff --git a/interfaces/inner_api/device_control/include/device_control_proxy.h b/interfaces/inner_api/device_control/include/device_control_proxy.h new file mode 100644 index 000000000..7c5b6cd77 --- /dev/null +++ b/interfaces/inner_api/device_control/include/device_control_proxy.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INTERFACES_INNER_API_DEVICE_CONTROL_INCLUDE_DEVICE_CONTROL_PROXY_H +#define INTERFACES_INNER_API_DEVICE_CONTROL_INCLUDE_DEVICE_CONTROL_PROXY_H +#include "enterprise_device_mgr_proxy.h" + +namespace OHOS { +namespace EDM { +class DeviceControlProxy { +public: + DeviceControlProxy(); + ~DeviceControlProxy(); + static std::shared_ptr GetDeviceControlProxy(); + int32_t ResetFactory(AppExecFwk::ElementName &admin); +private: + static std::shared_ptr proxy_; + static std::shared_ptr instance_; + static std::mutex mutexLock_; +}; +} // namespace EDM +} // namespace OHOS + +#endif // INTERFACES_INNER_API_DEVICE_INFO_INCLUDE_DEVICE_INFO_PROXY_H diff --git a/interfaces/inner_api/device_control/src/device_control_proxy.cpp b/interfaces/inner_api/device_control/src/device_control_proxy.cpp new file mode 100644 index 000000000..5e22a31f9 --- /dev/null +++ b/interfaces/inner_api/device_control/src/device_control_proxy.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "device_control_proxy.h" +#include "edm_log.h" +#include "func_code.h" +#include "policy_info.h" + +namespace OHOS { +namespace EDM { +std::shared_ptr DeviceControlProxy::instance_ = nullptr; +std::mutex DeviceControlProxy::mutexLock_; +const std::u16string DESCRIPTOR = u"ohos.edm.IEnterpriseDeviceMgr"; + +DeviceControlProxy::DeviceControlProxy() {} + +DeviceControlProxy::~DeviceControlProxy() {} + +std::shared_ptr DeviceControlProxy::GetDeviceControlProxy() +{ + if (instance_ == nullptr) { + std::lock_guard lock(mutexLock_); + if (instance_ == nullptr) { + std::shared_ptr temp = std::make_shared(); + instance_ = temp; + } + } + return instance_; +} + +int32_t DeviceControlProxy::ResetFactory(AppExecFwk::ElementName &admin) +{ + EDMLOGD("DeviceInfoProxy::ResetFactory"); + auto proxy = EnterpriseDeviceMgrProxy::GetInstance(); + if (proxy == nullptr) { + EDMLOGE("can not get EnterpriseDeviceMgrProxy"); + return EdmReturnErrCode::SYSTEM_ABNORMALLY; + } + MessageParcel data; + std::uint32_t funcCode = POLICY_FUNC_CODE((std::uint32_t)FuncOperateType::SET, RESET_FACTORY); + data.WriteInterfaceToken(DESCRIPTOR); + data.WriteParcelable(&admin); + return proxy->HandleDevicePolicy(funcCode, data); +} +} // namespace EDM +} // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/device_control/BUILD.gn b/interfaces/kits/device_control/BUILD.gn new file mode 100644 index 000000000..300efd92a --- /dev/null +++ b/interfaces/kits/device_control/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//base/customization/enterprise_device_management/edm.gni") +import("//build/ohos.gni") + +ohos_shared_library("devicecontrol") { + include_dirs = [ + "//third_party/node/src", + "$SUBSYSTEM_DIR/common/native/include", + "$SUBSYSTEM_DIR/interfaces/kits/device_control/include", + "$SUBSYSTEM_DIR/interfaces/kits/common/include", + "$SUBSYSTEM_DIR/interfaces/inner_api/include", + ] + + sources = [ + "$SUBSYSTEM_DIR/interfaces/kits/common/src/napi_edm_common.cpp", + "$SUBSYSTEM_DIR/interfaces/kits/common/src/napi_edm_error.cpp", + "src/device_control_addon.cpp", + ] + + configs = [ "//base/customization/enterprise_device_management/common/config:coverage_flags" ] + + deps = [ "$EDM_INNERKITS_PATH:edmservice_kits" ] + + external_deps = [ + "ability_base:want", + "hisysevent_native:libhisysevent", + "hiviewdfx_hilog_native:libhilog", + "ipc:ipc_core", + "napi:ace_napi", + ] + + relative_install_dir = "module/enterprise" + subsystem_name = "customization" + part_name = "enterprise_device_management" +} diff --git a/interfaces/kits/device_control/include/device_control_addon.h b/interfaces/kits/device_control/include/device_control_addon.h new file mode 100644 index 000000000..6d7babd99 --- /dev/null +++ b/interfaces/kits/device_control/include/device_control_addon.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INTERFACES_KITS_DEVICE_CONTROL_INCLUDE_DEVICE_CONTROL_ADDON_H +#define INTERFACES_KITS_DEVICE_CONTROL_INCLUDE_DEVICE_CONTROL_ADDON_H + +#include "device_control_proxy.h" +#include "enterprise_device_mgr_proxy.h" +#include "ienterprise_device_mgr.h" +#include "napi_edm_error.h" +#include "napi_edm_common.h" +#include "napi/native_common.h" +#include "napi/native_node_api.h" +#include "napi/native_api.h" +#include "want.h" + +namespace OHOS { +namespace EDM { +struct AsyncDeviceControlCallbackInfo : AsyncCallbackInfo { + OHOS::AppExecFwk::ElementName elementName; +}; + +class DeviceControlAddon { +public: + DeviceControlAddon(); + ~DeviceControlAddon() = default; + + static napi_value Init(napi_env env, napi_value exports); +private: + static napi_value ResetFactory(napi_env env, napi_callback_info info); + static void NativeResetFactory(napi_env env, void *data); + static std::shared_ptr deviceControlProxy_; +}; +} // namespace EDM +} // namespace OHOS + +#endif // INTERFACES_KITS_DATETIME_MANAGER_INCLUDE_DEVICE_INFO_ADDON_H \ No newline at end of file diff --git a/interfaces/kits/device_control/src/device_control_addon.cpp b/interfaces/kits/device_control/src/device_control_addon.cpp new file mode 100644 index 000000000..81f11e170 --- /dev/null +++ b/interfaces/kits/device_control/src/device_control_addon.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "device_control_addon.h" +#include "edm_log.h" + +using namespace OHOS::EDM; + +napi_value DeviceControlAddon::Init(napi_env env, napi_value exports) +{ + napi_property_descriptor property[] = { + DECLARE_NAPI_FUNCTION("resetFactory", ResetFactory), + }; + NAPI_CALL(env, napi_define_properties(env, exports, sizeof(property) / sizeof(property[0]), property)); + return exports; +} + +napi_value DeviceControlAddon::ResetFactory(napi_env env, napi_callback_info info) +{ + EDMLOGI("NAPI_resetFactory called"); + size_t argc = ARGS_SIZE_TWO; + napi_value argv[ARGS_SIZE_TWO] = {nullptr}; + napi_value thisArg = nullptr; + void *data = nullptr; + NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); + ASSERT_AND_THROW_PARAM_ERROR(env, argc >= ARGS_SIZE_ONE, "parameter count error"); + bool matchFlag = MatchValueType(env, argv[ARR_INDEX_ZERO], napi_object); + if (argc > ARGS_SIZE_ONE) { + matchFlag = matchFlag && MatchValueType(env, argv[ARR_INDEX_ONE], napi_function); + } + ASSERT_AND_THROW_PARAM_ERROR(env, matchFlag, "parameter type error"); + auto asyncCallbackInfo = new (std::nothrow) AsyncDeviceControlCallbackInfo(); + if (asyncCallbackInfo == nullptr) { + return nullptr; + } + std::unique_ptr callbackPtr {asyncCallbackInfo}; + bool ret = ParseElementName(env, asyncCallbackInfo->elementName, argv[ARR_INDEX_ZERO]); + ASSERT_AND_THROW_PARAM_ERROR(env, ret, "element name param error"); + EDMLOGD("resetFactory: asyncCallbackInfo->elementName.bundlename %{public}s, " + "asyncCallbackInfo->abilityname:%{public}s", + asyncCallbackInfo->elementName.GetBundleName().c_str(), + asyncCallbackInfo->elementName.GetAbilityName().c_str()); + if (argc > ARGS_SIZE_ONE) { + EDMLOGD("NAPI_resetFactory argc == ARGS_SIZE_TWO"); + napi_create_reference(env, argv[ARR_INDEX_ONE], NAPI_RETURN_ONE, &asyncCallbackInfo->callback); + } + napi_value asyncWorkReturn = HandleAsyncWork(env, asyncCallbackInfo, "ResetFactory", + NativeResetFactory, NativeVoidCallbackComplete); + callbackPtr.release(); + return asyncWorkReturn; +} + +void DeviceControlAddon::NativeResetFactory(napi_env env, void *data) +{ + EDMLOGI("NAPI_NativeResetFactory called"); + if (data == nullptr) { + EDMLOGE("data is nullptr"); + return; + } + AsyncDeviceControlCallbackInfo *asyncCallbackInfo = static_cast(data); + auto deviceControlProxy_ = DeviceControlProxy::GetDeviceControlProxy(); + if (deviceControlProxy_ == nullptr) { + EDMLOGE("can not get GetDeviceControlProxy"); + return; + } + asyncCallbackInfo->ret = deviceControlProxy_->ResetFactory(asyncCallbackInfo->elementName); +} + +static napi_module g_deviceControlModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = DeviceControlAddon::Init, + .nm_modname = "enterprise.deviceControl", + .nm_priv = ((void *)0), + .reserved = { 0 }, +}; + +extern "C" __attribute__((constructor)) void DateTimeManagerRegister() +{ + napi_module_register(&g_deviceControlModule); +} \ No newline at end of file diff --git a/services/edm/include/permission_manager.h b/services/edm/include/permission_manager.h index 28869a25a..0f4427f14 100644 --- a/services/edm/include/permission_manager.h +++ b/services/edm/include/permission_manager.h @@ -35,7 +35,8 @@ static const AdminPermission ADMIN_PERMISSIONS[] = { { "ohos.permission.EDM_TEST_PERMISSION", AdminType::NORMAL }, { "ohos.permission.EDM_TEST_ENT_PERMISSION", AdminType::ENT }, { "ohos.permission.ENTERPRISE_SET_DATETIME", AdminType::ENT }, - { "ohos.permission.ENTERPRISE_GET_DEVICE_INFO", AdminType::ENT } + { "ohos.permission.ENTERPRISE_GET_DEVICE_INFO", AdminType::ENT }, + { "ohos.permission.ENTERPRISE_RESET_DEVICE", AdminType::ENT }, }; class PermissionManager : public DelayedSingleton { diff --git a/services/edm_plugin/BUILD.gn b/services/edm_plugin/BUILD.gn index 984507268..3d6e61436 100644 --- a/services/edm_plugin/BUILD.gn +++ b/services/edm_plugin/BUILD.gn @@ -48,3 +48,16 @@ edm_plugin_shared_library("device_info_plugin") { "init:libbegetutil", ] } + +edm_plugin_shared_library("reset_factory_plugin") { + sources = [ "$PLUGIN_SRC_PATH/reset_factory_plugin.cpp" ] + + configs = [ "//base/customization/enterprise_device_management/common/config:coverage_flags" ] + + include_dirs = [] + + external_deps = [ + "c_utils:utils", + "update_service:updateservicekits", + ] +} \ No newline at end of file diff --git a/services/edm_plugin/include/reset_factory_plugin.h b/services/edm_plugin/include/reset_factory_plugin.h new file mode 100644 index 000000000..62633f135 --- /dev/null +++ b/services/edm_plugin/include/reset_factory_plugin.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SERVICES_EDM_PLUGIN_INCLUDE_RESET_FACTORY_PLUGIN_H +#define SERVICES_EDM_PLUGIN_INCLUDE_RESET_FACTORY_PLUGIN_H + +#include "iplugin_template.h" +#include "string_serializer.h" + +namespace OHOS { +namespace EDM { +class ResetFactoryPlugin : public PluginSingleton { +public: + void InitPlugin(std::shared_ptr> ptr) override; + + ErrCode OnSetPolicy(); +}; +} // namespace EDM +} // namespace OHOS + +#endif // SERVICES_EDM_PLUGIN_INCLUDE_RESET_FACTORY_PLUGIN_H \ No newline at end of file diff --git a/services/edm_plugin/src/reset_factory_plugin.cpp b/services/edm_plugin/src/reset_factory_plugin.cpp new file mode 100644 index 000000000..35e3bb167 --- /dev/null +++ b/services/edm_plugin/src/reset_factory_plugin.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "plugin_manager.h" +#include "policy_info.h" +#include "reset_factory_plugin.h" +#include "string_serializer.h" +#include "update_service_kits.h" + +namespace OHOS { +namespace EDM { +const bool REGISTER_RESULT = PluginManager::GetInstance()->AddPlugin(ResetFactoryPlugin::GetPlugin()); + +void ResetFactoryPlugin::InitPlugin(std::shared_ptr> ptr) +{ + EDMLOGD("ResetFactoryPlugin InitPlugin..."); + std::string policyName; + POLICY_CODE_TO_NAME(RESET_FACTORY, policyName); + ptr->InitAttribute(RESET_FACTORY, policyName, "ohos.permission.ENTERPRISE_RESET_DEVICE", false); + ptr->SetSerializer(StringSerializer::GetInstance()); + ptr->SetOnHandlePolicyListener(&ResetFactoryPlugin::OnSetPolicy, FuncOperateType::SET); +} + +ErrCode ResetFactoryPlugin::OnSetPolicy() +{ + EDMLOGD("ResetFactoryPlugin OnSetPolicy"); + UpdateEngine::BusinessError businessError; + int32_t ret = UpdateEngine::UpdateServiceKits::GetInstance().FactoryReset(businessError); + if (ret != ERR_OK) { + return SYSTEM_ABNORMALLY; + } + return ERR_OK; +} +} // namespace EDM +} // namespace OHOS -- Gitee