From 08804ca6ff83258e90f7e6c12c80d325c7613aec Mon Sep 17 00:00:00 2001 From: zixing000 Date: Wed, 23 Feb 2022 16:03:59 +0800 Subject: [PATCH 1/3] L1 build success. Signed-off-by: zixing000 --- BUILD.gn | 12 +-- interfaces/inner_kits/native_cpp/BUILD.gn | 45 +++++++++ .../native_cpp/src/device_manager_impl.cpp | 4 +- .../src/ipc/lite/ipc_client_server_proxy.cpp | 2 +- .../src/ipc/lite/ipc_cmd_parser.cpp | 1 + services/devicemanagerservice/BUILD.gn | 92 ++++++++++++++++++- .../commonevent/dm_common_event_manager.h | 2 +- .../src/adapter/lite/dm_adapter_manager.cpp | 22 ++--- .../src/authentication/dm_auth_manager.cpp | 10 ++ .../multipleuser/multiple_user_connector.cpp | 13 ++- .../dependency/softbus/softbus_connector.cpp | 2 +- .../src/device_manager_service.cpp | 11 ++- .../src/ipc/lite/ipc_cmd_parser.cpp | 9 +- .../src/ipc/lite/ipc_server_stub.cpp | 2 +- utils/BUILD.gn | 44 +++++++++ 15 files changed, 229 insertions(+), 42 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 7e5dfc76c..103ee5a70 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,13 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build/lite/config/component/lite_component.gni") - if (defined(ohos_lite)) { + import("//build/lite/config/component/lite_component.gni") lite_component("devicemanager_lite") { - if (ohos_kernel_type == "liteos_m") { - } else { - features = [] - } + features = [ + "utils:devicemanagerutils", + "services/devicemanagerservice:devicemanagerservice", + "interfaces/inner_kits/native_cpp:devicemanagersdk", + ] } } diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn index 99011143a..83eb9f7ca 100644 --- a/interfaces/inner_kits/native_cpp/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/BUILD.gn @@ -20,6 +20,51 @@ import("//foundation/distributedhardware/devicemanager/devicemanager.gni") if (defined(ohos_lite)) { shared_library("devicemanagersdk") { + include_dirs = [ + "include", + "include/ipc", + "include/ipc/lite", + "include/notify", + "${common_path}/include", + "${common_path}/include/ipc", + "${common_path}/include/ipc/model", + "${utils_path}/include", + "${utils_path}/include/ipc/lite", + ] + include_dirs += [ + "//utils/native/lite/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", + "//third_party/bounds_checking_function/include", + "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", + "//third_party/json/include", + "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/", + ] + sources = [ + "src/device_manager.cpp", + "src/device_manager_impl.cpp", + "src/ipc/ipc_client_proxy.cpp", + "src/ipc/lite/ipc_client_manager.cpp", + "src/ipc/lite/ipc_client_server_proxy.cpp", + "src/ipc/lite/ipc_client_stub.cpp", + "src/ipc/lite/ipc_cmd_parser.cpp", + "src/notify/device_manager_notify.cpp", + ] + deps = [ + "${utils_path}:devicemanagerutils", + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/distributedschedule/samgr_lite/samgr:samgr", + "//third_party/bounds_checking_function:libsec_shared", + "//utils/native/lite:utils", + "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/js/builtin:capability_api", + ] + defines = [ + "LITE_DEVICE", + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"devicemanagerkit\"", + "LOG_DOMAIN=0xD004100", + ] } } else { config("devicemanagersdk_config") { diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp index 811a6d7f4..c263097bb 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -20,10 +20,11 @@ #include "bundle_info.h" #include "bundle_mgr_client.h" #include "bundle_mgr_interface.h" -#endif #include "if_system_ability_manager.h" #include "iservice_registry.h" #include "system_ability_definition.h" +#include "ipc_skeleton.h" +#endif #include "device_manager_notify.h" #include "dm_constants.h" @@ -38,7 +39,6 @@ #include "ipc_req.h" #include "ipc_rsp.h" #include "ipc_set_useroperation_req.h" -#include "ipc_skeleton.h" #include "ipc_start_discovery_req.h" #include "ipc_stop_discovery_req.h" #include "ipc_unauthenticate_device_req.h" diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp index 0df352799..21de9b5df 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp @@ -23,10 +23,10 @@ namespace OHOS { namespace DistributedHardware { +const int32_t INVALID_CB_ID = 0xFF; static uint32_t g_deathCbId = INVALID_CB_ID; static SvcIdentity g_svcIdentity; static std::shared_ptr pCurRsp; -const int32_t INVALID_CB_ID = 0xFF; void __attribute__((weak)) HOS_SystemInit(void) { diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp index e1a881b90..9594d21e0 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp @@ -28,6 +28,7 @@ #include "ipc_start_discovery_req.h" #include "ipc_stop_discovery_req.h" #include "ipc_verify_authenticate_req.h" +#include "ipc_set_useroperation_req.h" #include "securec.h" namespace OHOS { diff --git a/services/devicemanagerservice/BUILD.gn b/services/devicemanagerservice/BUILD.gn index cde4b3193..23f16507d 100644 --- a/services/devicemanagerservice/BUILD.gn +++ b/services/devicemanagerservice/BUILD.gn @@ -20,8 +20,96 @@ if (defined(ohos_lite)) { import("//foundation/distributedhardware/devicemanager/devicemanager.gni") if (defined(ohos_lite)) { - executable("devicemanagerservice") { - sources = [ "src/ipc/lite/ipc_server_main.cpp" ] + shared_library("devicemanagerservice") { + include_dirs = [ + "include", + "include/config", + "include/adapter", + "include/authentication", + "include/ability", + "include/deviceinfo", + "include/devicestate", + "include/discovery", + "include/dependency/multipleuser/", + "include/dependency/hichain", + "include/dependency/softbus", + "include/dependency/timer", + "include/ipc", + "include/ipc/lite", + "include/eventbus", + "${common_path}/include", + "${common_path}/include/ipc", + "${common_path}/include/ipc/model", + "${utils_path}/include", + "${utils_path}/include/ipc/lite", + "${innerkits_path}/native_cpp/include", + "${innerkits_path}/native_cpp/include/ipc", + "${innerkits_path}/native_cpp/include/ipc/lite", + ] + include_dirs += [ + "//base/security/deviceauth/interfaces/innerkits", + "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include", + "//utils/native/lite/include", + "//utils/system/safwk/native/include", + "//third_party/json/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", + "//third_party/bounds_checking_function/include", + "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/dsoftbus/interfaces/kits/bus_center", + "//foundation/communication/dsoftbus/interfaces/kits/common", + "//foundation/communication/dsoftbus/interfaces/kits/discovery", + "//foundation/communication/dsoftbus/interfaces/kits/transport", + "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", + "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", + ] + + sources = [ + "src/ability/lite/dm_ability_manager.cpp", + "src/adapter/lite/dm_adapter_manager.cpp", + "src/authentication/auth_message_processor.cpp", + "src/authentication/auth_request_state.cpp", + "src/authentication/auth_response_state.cpp", + "src/authentication/auth_ui.cpp", + "src/authentication/dm_auth_manager.cpp", + "src/config/dm_config_manager.cpp", + "src/dependency/hichain/hichain_connector.cpp", + "src/dependency/multipleuser/multiple_user_connector.cpp", + "src/dependency/softbus/softbus_connector.cpp", + "src/dependency/softbus/softbus_session.cpp", + "src/dependency/timer/dm_timer.cpp", + "src/device_manager_service.cpp", + "src/device_manager_service_listener.cpp", + "src/deviceinfo/dm_device_info_manager.cpp", + "src/devicestate/dm_device_state_manager.cpp", + "src/discovery/dm_discovery_manager.cpp", + "src/ipc/lite/ipc_cmd_parser.cpp", + "src/ipc/lite/ipc_server_listener.cpp", + "src/ipc/lite/ipc_server_stub.cpp", + ] + ldflags = dm_ldflags + + defines = [ + "LITE_DEVICE", + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"devicemanagerservice\"", + "LOG_DOMAIN=0xD004100", + ] + + deps = [ + "${common_path}/include/dialog_ui/js:dialog_js_files_etc", + "${innerkits_path}/native_cpp:devicemanagersdk", + "${utils_path}:devicemanagerutils", + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//base/security/deviceauth/services:deviceauth_sdk", + "//base/startup/syspara_lite/frameworks/parameter/src:sysparam", + "//foundation/communication/dsoftbus/sdk:softbus_client", + "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/distributedschedule/samgr_lite/samgr:samgr", + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/mbedtls:mbedtls_shared", + "//utils/native/lite:utils", + ] } } else if (!support_jsapi) { group("devicemanagerservice") { diff --git a/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h b/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h index 81d51bb2a..3f4ee0567 100644 --- a/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h +++ b/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h @@ -67,4 +67,4 @@ private: }; } // namespace DistributedHardware } // namespace OHOS -#endif // OHOS_EVENT_MANAGER_ADAPT_H \ No newline at end of file +#endif // OHOS_EVENT_MANAGER_ADAPT_H diff --git a/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp b/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp index 9cca65109..ac6f5c480 100644 --- a/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp +++ b/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp @@ -26,29 +26,19 @@ DmAdapterManager &DmAdapterManager::GetInstance() return instance; } -DmAdapterManager::DmAdapterManager() +std::shared_ptr DmAdapterManager::GetDecisionAdapter(const std::string &soName) { - LOGI("DmAdapterManager constructor"); + return NULL; } -DmAdapterManager::~DmAdapterManager() +std::shared_ptr DmAdapterManager::GetProfileAdapter(const std::string &soName) { - LOGI("DmAdapterManager destructor"); + return NULL; } -std::shared_ptr DmAdapterManager::GetDecisionAdapter() +std::shared_ptr DmAdapterManager::GetCryptoAdapter(const std::string &soName) { - return decisionAdapterPtr_; -} - -std::shared_ptr DmAdapterManager::GetProfileAdapter() -{ - return profileAdapterPtr_; -} - -std::shared_ptr DmAdapterManager::GetCryptoAdapter() -{ - return cryptoAdapterPtr_; + return NULL; } } // namespace DistributedHardware } // namespace OHOS diff --git a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp index dfe504b5c..47d7bf276 100644 --- a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp +++ b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp @@ -25,9 +25,11 @@ #include "multiple_user_connector.h" #include "nlohmann/json.hpp" #include "parameter.h" +#ifndef LITE_DEVICE #include "ui_service_mgr_client.h" #include "dialog_callback_stub.h" #include "dialog_callback.h" +#endif namespace OHOS { namespace DistributedHardware { @@ -520,7 +522,9 @@ int32_t DmAuthManager::AddMember(const std::string &deviceId) return DM_FAILED; } LOGI("DmAuthManager::authRequestContext CancelDisplay start"); +#ifndef LITE_DEVICE Ace::UIServiceMgrClient::GetInstance()->CancelDialog(authResponseContext_->aceId); +#endif return DM_OK; } @@ -546,9 +550,11 @@ void DmAuthManager::AuthenticateFinish() { LOGI("DmAuthManager::AuthenticateFinish start"); if (authResponseState_ != nullptr) { +#ifndef LITE_DEVICE if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_FINISH) { Ace::UIServiceMgrClient::GetInstance()->CancelDialog(authResponseContext_->aceId); } +#endif if (!timerMap_.empty()) { for (auto &iter : timerMap_) { iter.second->Stop(SESSION_CANCEL_TIMEOUT); @@ -568,9 +574,11 @@ void DmAuthManager::AuthenticateFinish() authResponseContext_->state = AuthState::AUTH_REQUEST_INIT; } +#ifndef LITE_DEVICE if (authResponseContext_->state == AuthState::AUTH_REQUEST_INPUT) { Ace::UIServiceMgrClient::GetInstance()->CancelDialog(authResponseContext_->aceId); } +#endif listener_->OnAuthResult(authRequestContext_->hostPkgName, authRequestContext_->deviceId, authRequestContext_->token, authResponseContext_->state, authRequestContext_->reason); @@ -664,6 +672,7 @@ void DmAuthManager::ShowConfigDialog() const std::string params = jsonObj.dump(); std::shared_ptr authMgr_ = shared_from_this(); +#ifndef LITE_DEVICE Ace::UIServiceMgrClient::GetInstance()->ShowDialog( "config_dialog_service", params, @@ -674,6 +683,7 @@ void DmAuthManager::ShowConfigDialog() LOGI("CancelDialog start id:%d,event:%s,parms:%s", id, event.c_str(), params.c_str()); authMgr_->StartAuthProcess(atoi(params.c_str())); }); +#endif LOGI("ShowConfigDialog end"); } diff --git a/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp b/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp index 4168ce99e..18835da75 100644 --- a/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp +++ b/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp @@ -17,9 +17,10 @@ #include "dm_constants.h" #include "dm_log.h" +#ifndef LITE_DEVICE #include "os_account_manager.h" - using namespace OHOS::AccountSA; +#endif namespace OHOS { namespace DistributedHardware { @@ -27,12 +28,16 @@ int32_t MultipleUserConnector::oldUserId_ = -1; int32_t MultipleUserConnector::GetCurrentAccountUserID(void) { +#ifndef LITE_DEVICE std::vector ids; ErrCode ret = OsAccountManager::QueryActiveOsAccountIds(ids); if (ret != ERR_OK || ids.empty()) { return -1; } return ids[0]; +#else + return 0; +#endif } void MultipleUserConnector::SetSwitchOldUserId(int32_t userId) @@ -42,7 +47,11 @@ void MultipleUserConnector::SetSwitchOldUserId(int32_t userId) int32_t MultipleUserConnector::GetSwitchOldUserId(void) { +#ifndef LITE_DEVICE return oldUserId_; +#else + return 0; +#endif } } // namespace DistributedHardware -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp index 4ece01e32..9ee2d2a95 100644 --- a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp +++ b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp @@ -556,4 +556,4 @@ void SoftbusConnector::OnParameterChgCallback(const char *key, const char *value } } } // namespace DistributedHardware -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/devicemanagerservice/src/device_manager_service.cpp b/services/devicemanagerservice/src/device_manager_service.cpp index 8a02d7265..3a4609e95 100644 --- a/services/devicemanagerservice/src/device_manager_service.cpp +++ b/services/devicemanagerservice/src/device_manager_service.cpp @@ -17,15 +17,19 @@ #include +#ifndef LITE_DEVICE #include "common_event_support.h" -#include "device_manager_service_listener.h" #include "dm_common_event_manager.h" +#endif +#include "device_manager_service_listener.h" #include "dm_constants.h" #include "dm_device_info_manager.h" #include "dm_log.h" #include "multiple_user_connector.h" +#ifndef LITE_DEVICE using namespace OHOS::EventFwk; +#endif namespace OHOS { namespace DistributedHardware { @@ -34,10 +38,12 @@ IMPLEMENT_SINGLE_INSTANCE(DeviceManagerService); DeviceManagerService::~DeviceManagerService() { LOGI("DeviceManagerService destructor"); +#ifndef LITE_DEVICE DmCommonEventManager &dmCommonEventManager = DmCommonEventManager::GetInstance(); if (dmCommonEventManager.UnsubscribeServiceEvent(CommonEventSupport::COMMON_EVENT_USER_STOPPED)) { LOGI("subscribe service event success"); } +#endif softbusConnector_->GetSoftbusSession()->UnRegisterSessionCallback(); hiChainConnector_->UnRegisterHiChainCallback(); } @@ -106,13 +112,14 @@ int32_t DeviceManagerService::Init() LOGI("get current account user id success"); MultipleUserConnector::SetSwitchOldUserId(userId); } - +#ifndef LITE_DEVICE DmCommonEventManager &dmCommonEventManager = DmCommonEventManager::GetInstance(); CommomEventCallback callback = std::bind(&DmAuthManager::UserSwitchEventCallback, *authMgr_.get(), std::placeholders::_1); if (dmCommonEventManager.SubscribeServiceEvent(CommonEventSupport::COMMON_EVENT_USER_SWITCHED, callback)) { LOGI("subscribe service user switch common event success"); } +#endif LOGI("Init success, singleton initialized"); intFlag_ = true; diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index 6e14961b3..786c5fbed 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -220,10 +220,8 @@ ON_IPC_SERVER_CMD(UNAUTHENTICATE_DEVICE, IpcIo &req, IpcIo &reply) ON_IPC_SERVER_CMD(VERIFY_AUTHENTICATION, IpcIo &req, IpcIo &reply) { LOGI("VerifyAuthentication service listener."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); std::string authParam = (const char *)IpcIoPopString(&req, nullptr); - - int32_t ret = DeviceManagerService::GetInstance().VerifyAuthentication(pkgName, authParam); + int32_t ret = DeviceManagerService::GetInstance().VerifyAuthentication(authParam); IpcIoPushInt32(&reply, ret); } @@ -247,10 +245,5 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FA_NOTIFY, std::shared_ptr pBaseReq, Ip return DM_OK; } -ON_IPC_READ_RESPONSE(SERVER_DEVICE_FA_NOTIFY, IpcIo &request, std::shared_ptr pBaseRsp) -{ - pBaseRsp->SetErrCode(reply.ReadInt32()); - return DM_OK; -} } // namespace DistributedHardware } // namespace OHOS diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp index 1a09f1cb6..223faf210 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp @@ -196,7 +196,7 @@ static void HOS_SystemInit(void) return; } -static int32_t IpcServerStubInit(void) +int32_t IpcServerStubInit(void) { HOS_SystemInit(); return DM_OK; diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 7080341e1..dee2b3dc8 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -21,6 +21,50 @@ import("//foundation/distributedhardware/devicemanager/devicemanager.gni") if (defined(ohos_lite)) { shared_library("devicemanagerutils") { + include_dirs = [ + "${common_path}/include", + "${common_path}/include/ipc", + "${common_path}/include/ipc/model", + "include", + "include/ipc/lite", + ] + include_dirs += [ + "//base/security/deviceauth/interfaces/innerkits", + "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include", + "//utils/native/lite/include", + "//utils/system/safwk/native/include", + "//third_party/json/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", + "//third_party/bounds_checking_function/include", + "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/dsoftbus/interfaces/kits/bus_center", + "//foundation/communication/dsoftbus/interfaces/kits/common", + "//foundation/communication/dsoftbus/interfaces/kits/discovery", + "//foundation/communication/dsoftbus/interfaces/kits/transport", + "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", + ] + sources = [ + "src/dm_anonymous.cpp", + "src/dm_log.cpp", + "src/dm_random.cpp", + "src/ipc/lite/ipc_cmd_register.cpp", + ] + defines = [ + "hI_LOG_ENABLE", + "DH_LOG_TAG=\"devicemanagerutils\"", + "lOG_DOMAIN=0xD004100", + ] + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//base/startup/syspara_lite/frameworks/parameter/src:sysparam", + "//foundation/communication/dsoftbus/sdk:softbus_client", + "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/distributedschedule/samgr_lite/samgr:samgr", + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/mbedtls:mbedtls_shared", + "//utils/native/lite:utils", + ] } } else { config("devicemanagerutils_config") { -- Gitee From 35ff0efe4d3c567240097f2689236f69d9583130 Mon Sep 17 00:00:00 2001 From: zixing000 Date: Thu, 3 Mar 2022 15:27:31 +0800 Subject: [PATCH 2/3] L1 devicemanagertest build success. Signed-off-by: zixing000 --- BUILD.gn | 1 + interfaces/inner_kits/native_cpp/BUILD.gn | 3 +- services/devicemanagerservice/BUILD.gn | 6 +- .../dependency/softbus/softbus_connector.cpp | 3 + .../src/ipc/lite/ipc_cmd_parser.cpp | 1 - .../src/ipc/lite/ipc_server_main.cpp | 26 +- test_lite/BUILD.gn | 55 +++ test_lite/device_manager_test.cpp | 322 ++++++++++++++++++ 8 files changed, 412 insertions(+), 5 deletions(-) create mode 100644 test_lite/BUILD.gn create mode 100644 test_lite/device_manager_test.cpp diff --git a/BUILD.gn b/BUILD.gn index 103ee5a70..5b25f37c8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -18,6 +18,7 @@ if (defined(ohos_lite)) { "utils:devicemanagerutils", "services/devicemanagerservice:devicemanagerservice", "interfaces/inner_kits/native_cpp:devicemanagersdk", + "test_lite:devicemanagertest", ] } } diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn index 83eb9f7ca..5abacecb7 100644 --- a/interfaces/inner_kits/native_cpp/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/BUILD.gn @@ -37,6 +37,7 @@ if (defined(ohos_lite)) { "//third_party/bounds_checking_function/include", "//foundation/communication/ipc_lite/interfaces/kits", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//third_party/json/include", "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/", ] @@ -57,7 +58,7 @@ if (defined(ohos_lite)) { "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//utils/native/lite:utils", - "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/js/builtin:capability_api", + # "//foundation/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/js/builtin:capability_api", ] defines = [ "LITE_DEVICE", diff --git a/services/devicemanagerservice/BUILD.gn b/services/devicemanagerservice/BUILD.gn index 23f16507d..758391db5 100644 --- a/services/devicemanagerservice/BUILD.gn +++ b/services/devicemanagerservice/BUILD.gn @@ -20,7 +20,7 @@ if (defined(ohos_lite)) { import("//foundation/distributedhardware/devicemanager/devicemanager.gni") if (defined(ohos_lite)) { - shared_library("devicemanagerservice") { + executable("devicemanagerservice") { include_dirs = [ "include", "include/config", @@ -34,7 +34,7 @@ if (defined(ohos_lite)) { "include/dependency/hichain", "include/dependency/softbus", "include/dependency/timer", - "include/ipc", + "include", "include/ipc/lite", "include/eventbus", "${common_path}/include", @@ -85,6 +85,8 @@ if (defined(ohos_lite)) { "src/discovery/dm_discovery_manager.cpp", "src/ipc/lite/ipc_cmd_parser.cpp", "src/ipc/lite/ipc_server_listener.cpp", + "src/ipc/lite/ipc_server_listenermgr.cpp", + "src/ipc/lite/ipc_server_main.cpp", "src/ipc/lite/ipc_server_stub.cpp", ] ldflags = dm_ldflags diff --git a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp index 9ee2d2a95..5e58fb12e 100644 --- a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp +++ b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp @@ -72,6 +72,7 @@ int32_t SoftbusConnector::Init() } while (ret != DM_OK); LOGI("RegNodeDeviceStateCb success."); +#ifndef LITE_DEVICE PublishInfo dmPublishInfo; dmPublishInfo.publishId = DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID; dmPublishInfo.mode = DiscoverMode::DISCOVER_MODE_ACTIVE; @@ -108,6 +109,7 @@ int32_t SoftbusConnector::Init() ret = WatchParameter(DISCOVER_STATUS_KEY.c_str(), &SoftbusConnector::OnParameterChgCallback, nullptr); LOGI("register Watch Parameter result is : %d"); +#endif return ret; } @@ -196,6 +198,7 @@ int32_t SoftbusConnector::StartDiscovery(const DmSubscribeInfo &dmSubscribeInfo) LOGE("StartDiscovery failed with ret %d.", ret); return DM_DISCOVERY_FAILED; } + LOGI("StartDiscovery success."); return DM_OK; } diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index 786c5fbed..be07c9ba8 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -244,6 +244,5 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FA_NOTIFY, std::shared_ptr pBaseReq, Ip IpcIoPushString(&request, paramJson.c_str()); return DM_OK; } - } // namespace DistributedHardware } // namespace OHOS diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp index e4373c2ad..05f742251 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp @@ -16,12 +16,36 @@ #include #include +#include "device_manager_service.h" +#include "dm_constants.h" +#include "dm_log.h" +#include "ipc_server_stub.h" + +using namespace OHOS::DistributedHardware; + +static void InitAll() +{ + const int32_t DM_SERVICE_INIT_DELAY = 2; + sleep(DM_SERVICE_INIT_DELAY); + if (IpcServerStubInit() != DM_OK) { + LOGI("IpcServerStubInit failed"); + return; + } + DeviceManagerService::GetInstance().Init(); + // if (IpcServerAdapter::GetInstance().ModuleInit() != DM_OK) { + // LOGI("module init failed"); + // return; + // } + LOGI("DM ipc server Init success"); +} + int32_t main(int32_t argc, char *argv[]) { (void)argc; (void)argv; + InitAll(); while (1) { pause(); } return 0; -} \ No newline at end of file +} diff --git a/test_lite/BUILD.gn b/test_lite/BUILD.gn new file mode 100644 index 000000000..c832f9731 --- /dev/null +++ b/test_lite/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (C) 2021 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. + +if (defined(ohos_lite)) { + import("//build/lite/config/component/lite_component.gni") +} else { + import("//build/ohos.gni") +} + +import("//foundation/distributedhardware/devicemanager/devicemanager.gni") + +if (defined(ohos_lite)) { + executable("devicemanagertest") { + include_dirs = [ + "${common_path}/include", + "${common_path}/include/ipc", + "${common_path}/include/ipc/model", + "${utils_path}/include", + "${utils_path}/include/ipc/lite", + "${innerkits_path}/native_cpp/include", + "${innerkits_path}/native_cpp/include/ipc", + "${innerkits_path}/native_cpp/include/ipc/lite", + "//utils/native/lite/include", + "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", + "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", + ] + sources = [ + "device_manager_test.cpp", + ] + defines = [ + "LITE_DEVICE", + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"devicemanagerservice\"", + "LOG_DOMAIN=0xD004100", + ] + # cflags_cc = build_flags; + deps = [ + "${innerkits_path}/native_cpp:devicemanagersdk", + "${utils_path}:devicemanagerutils", + "//utils/native/lite:utils", + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + ] + } +} diff --git a/test_lite/device_manager_test.cpp b/test_lite/device_manager_test.cpp new file mode 100644 index 000000000..7e60f67cd --- /dev/null +++ b/test_lite/device_manager_test.cpp @@ -0,0 +1,322 @@ +#include +#include +#include +#include +#include +#include + +#include "securec.h" + +#include "device_manager_impl.h" +#include "device_manager_callback.h" +#include "dm_constants.h" +#include "dm_log.h" +// #include "ipc_server_stub.h" + +// #include "encrypt_utils.h" + +using namespace OHOS::DistributedHardware; + +namespace { +DmDeviceInfo g_deviceInfo; +std::vector g_deviceInfoList; +// const char *DM_CAPABILITY_OSD = "osdCapability"; +std::string g_pinToken = ""; +static std::string packageName = "com.huawei.dosdemo1"; +const int32_t BUF_SIZE = 45 * 1024; +uint8_t g_buf[BUF_SIZE]; +std::mutex lock_; +int32_t g_selectedDeviceNo = 0; +} + +class DmTestInitCallback : public DmInitCallback { +public: + explicit DmTestInitCallback(std::string &bundleName):bundleName_(bundleName) {} + virtual ~DmTestInitCallback(){} + void OnRemoteDied() override; +private: + std::string bundleName_; +}; + +void DmTestInitCallback::OnRemoteDied() +{ + LOGI("OnRemoteDied"); +} + +class DmTestDeviceStateCallback : public DeviceStateCallback { +public: + explicit DmTestDeviceStateCallback(std::string &bundleName):bundleName_(bundleName) {} + virtual ~DmTestDeviceStateCallback(){} + void OnDeviceOnline(const DmDeviceInfo &deviceInfo) override; + void OnDeviceReady(const DmDeviceInfo &deviceInfo) override; + void OnDeviceOffline(const DmDeviceInfo &deviceInfo) override; + void OnDeviceChanged(const DmDeviceInfo &deviceInfo) override; +private: + std::string bundleName_; +}; + +void DmTestDeviceStateCallback::OnDeviceOnline(const DmDeviceInfo &deviceInfo) +{ + LOGI("deviceId:%s, deviceName:%s", deviceInfo.deviceId, deviceInfo.deviceName); + g_deviceInfo = deviceInfo; +} + +void DmTestDeviceStateCallback::OnDeviceReady(const DmDeviceInfo &deviceInfo) +{ + LOGI("deviceId:%s, deviceName:%s", deviceInfo.deviceId, deviceInfo.deviceName); + g_deviceInfo = deviceInfo; +} + +void DmTestDeviceStateCallback::OnDeviceOffline(const DmDeviceInfo &deviceInfo) +{ + LOGI("deviceId:%s, deviceName:%s", deviceInfo.deviceId, deviceInfo.deviceName); + g_deviceInfo = deviceInfo; +} + +void DmTestDeviceStateCallback::OnDeviceChanged(const DmDeviceInfo &deviceInfo) +{ + LOGI("deviceId:%s, deviceName:%s", deviceInfo.deviceId, deviceInfo.deviceName); + g_deviceInfo = deviceInfo; +} + +class DmTestDiscoverCallback : public DiscoveryCallback { +public: + explicit DmTestDiscoverCallback(std::string &bundleName):bundleName_(bundleName) {} + virtual ~DmTestDiscoverCallback(){} + void OnDeviceFound(uint16_t subscribeld, const DmDeviceInfo &deviceInfo) override; + void OnDiscoveryFailed(uint16_t subscribeld, int32_t failedReason) override; + void OnDiscoverySuccess(uint16_t subscribeld) override; +private: + std::string bundleName_; +}; + +void DmTestDiscoverCallback::OnDeviceFound(uint16_t subscribeld, const DmDeviceInfo &deviceInfo) +{ + std::lock_guard autoLock(lock_); + g_deviceInfoList.emplace_back(deviceInfo); + g_deviceInfo = g_deviceInfoList[0]; + for (int i = 0; i < g_deviceInfoList.size(); ++i){ + LOGI("deviceNo:%d, deviceId:%s, deviceName:%s", + i, g_deviceInfoList[i].deviceId, g_deviceInfoList[i].deviceName); + } +} + +void DmTestDiscoverCallback::OnDiscoveryFailed(uint16_t subscribeId, int32_t failedReason) +{ + LOGI("OnDiscoverFailed, subscribeId:%u, failedReason:%d", subscribeId, failedReason); +} + +void DmTestDiscoverCallback::OnDiscoverySuccess(uint16_t subscribeId) +{ + LOGI("OnDiscoverSuccess, subscribeId:%u", subscribeId); +} + +class DmTestAuthenticateCallback : public AuthenticateCallback { +public: + explicit DmTestAuthenticateCallback(std::string &bundleName):bundleName_(bundleName) {} + virtual ~DmTestAuthenticateCallback(){} + void OnAuthResult(const std::string &deviceId, const std::string &pinToken, + int32_t status, int32_t reason) override; + +private: + std::string bundleName_; +}; + +void DmTestAuthenticateCallback::OnAuthResult(const std::string &deviceId, + const std::string &pinToken, int32_t status, int32_t reason) +{ + LOGI("OnAuthResult, deviceId:%s, status:%d, pinToken:%s", deviceId.c_str(), status, pinToken.c_str()); + g_pinToken = pinToken; +} + +class DmTestVerifyAuthCallback : public VerifyAuthCallback { +public: + explicit DmTestVerifyAuthCallback(std::string &bundleName):bundleName_(bundleName) {} + virtual ~DmTestVerifyAuthCallback(){}; + void OnVerifyAuthResult(const std::string &deviceId, + int32_t resultCode, int32_t flag) override; +private: + std::string bundleName_; +}; + +void DmTestVerifyAuthCallback::OnVerifyAuthResult(const std::string &deviceId, int32_t resultCode, int32_t flag) +{ + LOGI("check deviceId:%s, resultCode:%d, flag:%d", deviceId.c_str(), resultCode, flag); +} + +static std::string g_usage = "InitDeviceManager\n" + "StartDeviceDiscovery\n" + "SelectDeviceNo\n" + "AuthenticateDevice\n" + "CheckAuthentication\n" + "GetTrustedDeviceList\n" + "StopDeviceDiscovery\n" + "UnInitDeviceManager\n" + "Exit\n" + "InputPlainText\n" + "DecryptTexit\n"; + +static void printUsage() +{ + LOGI("use the following cmds \n%s", g_usage.c_str()); +} + +std::shared_ptr initCallback; + +void InitDeviceManager() +{ + LOGI("devicemanagertest start. package name:%s", packageName.c_str()); + initCallback = std::make_shared(packageName); + if (DeviceManager::GetInstance().InitDeviceManager(packageName, initCallback) == DM_OK) { + LOGI("InitDeviceManager success"); + } +} + +std::shared_ptr discoverCallback; + +void StartDeviceDiscovery() +{ + DmSubscribeInfo dmSubscribeInfo = { + 0, + DM_DISCOVER_MODE_ACTIVE, + DM_AUTO, + DM_HIGH, + false, + true, + "", + }; + g_deviceInfoList.clear(); + g_selectedDeviceNo = 0; + std::string extra = "extra"; + (void)strncpy_s(dmSubscribeInfo.capability, sizeof(dmSubscribeInfo.capability), + DM_CAPABILITY_OSD, strlen(DM_CAPABILITY_OSD)); + discoverCallback = std::make_shared(packageName); + if (DeviceManager::GetInstance().StartDeviceDiscovery( + packageName, dmSubscribeInfo, extra, discoverCallback) == DM_OK) { + LOGI("startDeviceDiscover success"); + } +} + +std::shared_ptr authenticateCallback; + +void AuthenticateDevice() +{ + uint8_t * appIconTmp = (uint8_t*)malloc(10); + appIconTmp[9] = 'B'; + uint8_t * appThumbnailTmp = (uint8_t*)malloc(600); + appThumbnailTmp[599] = 'C'; + + DmAppImageInfo dmAppImageInfo(appIconTmp, 10, appThumbnailTmp, 600); + std::string authExtra = "{\n" + "\"authType\": 1,\n" + "\"targetPkgName\": \"com.huawei.dosdemo1\",\n" + "\"appName\": \"zhengjianming\",\n" + "\"appDescription\": \"hehe\", \n" + "\"business\": 0\n" + "}"; + authenticateCallback = std::make_shared(packageName); + if (DeviceManager::GetInstance().AuthenticateDevice( + packageName, 1, g_deviceInfo,authExtra, authenticateCallback) == DM_OK){ + LOGI("AuthenticateDevice success"); + } + free(appIconTmp); + free(appThumbnailTmp); +} + +std::shared_ptr verifyAuthCallback; + +void CheckAuthentication(std::string& pinCode) +{ + std::string authPara = "{\n" + "\"authType\": 1,\n" + "\"pinCode\": " + pinCode + ",\n" + "\"pinToken\": " + g_pinToken.c_str() + + "}"; + LOGI("authPara:\n%s", authPara.c_str()); + verifyAuthCallback = std::make_shared(packageName); + if (DeviceManager::GetInstance().VerifyAuthentication( + packageName, authPara, verifyAuthCallback) == DM_OK){ + LOGI("CheckAuthentication success"); + } +} + +void GetTrustedDeviceList() +{ + std::vector dmDeviceInfoVec; + std::string extra = "extra"; + if (DeviceManager::GetInstance().GetTrustedDeviceList( + packageName, extra, dmDeviceInfoVec) == DM_OK){ + LOGI("GetTrustedDeviceList success"); + for (DmDeviceInfo dmDeviceInfo : dmDeviceInfoVec) { + LOGI("deviceID: %s,\ndeviceName: %s", + dmDeviceInfo.deviceId, dmDeviceInfo.deviceName); + } + } +} + +void StopDeviceDiscovery() +{ + if (DeviceManager::GetInstance().StopDeviceDiscovery( + packageName, 0) == DM_OK){ + LOGI("StopDeviceDiscovery success"); + } +} + +void UnInitDeviceManager() +{ + if (DeviceManager::GetInstance().UnInitDeviceManager(packageName) == DM_OK){ + LOGI("UnInitDeviceManager success"); + } +} + + +int main(){ + printUsage(); + std::string cmd; + while (std::cin >> cmd) { + if (cmd == "InitDeviceManager") { + InitDeviceManager(); + } else if (cmd == "StartDeviceDiscovery") { + StartDeviceDiscovery(); + } else if (cmd == "SelectDeviceNo") { + int32_t selectNo; + std::cin >> selectNo; + g_selectedDeviceNo = selectNo < g_deviceInfoList.size() ? selectNo : 0; + g_deviceInfo = g_deviceInfoList[g_selectedDeviceNo]; + } else if (cmd == "AuthenticateDevice") { + AuthenticateDevice(); + } else if (cmd == "CheckAuthentication") { + std::string pinCode = ""; + std::cin >> pinCode; + CheckAuthentication(pinCode); + } else if (cmd == "GetTrustedDeviceList") { + GetTrustedDeviceList(); + } else if (cmd == "StopDeviceDiscovery") { + StopDeviceDiscovery(); + } else if (cmd == "UnInitDeviceManager") { + UnInitDeviceManager(); + } else if (cmd == "InputEncryptText") { + // std::string plainText = ""; + // std::cin >> plainText; + // int32_t outLen = 0; + // memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE); + // EncryptUtils::MbedtlsEncrypt((const uint8_t*)encryptText.c_str(), encryptText.size(), + // g_buf, encryptText.size(), &outLen); + LOGI("EncryptText:%s\n", g_buf); + } else if (cmd == "DecryptTexit") { + // int32_t outLen = 0; + // std::string encryptText = (const char*)g_buf; + // memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE); + // EncryptUtils::MbedtlsDecrypt((const uint8_t*)encryptText.c_str(), encryptText.size(), + // g_buf, encryptText.size(), &outLen); + LOGI("PlainText:%s\n", g_buf); + } else if (cmd == "Exit") { + break; + } else { + LOGI("unknown cmd\n"); + } + LOGI("%s end\n", cmd.c_str()); + printUsage(); + } + return 0; +} -- Gitee From b9a827ac924b11a6ed806ea9f624e44c1412cdae Mon Sep 17 00:00:00 2001 From: pang-wenbin2 Date: Fri, 4 Mar 2022 14:09:04 +0800 Subject: [PATCH 3/3] daily --- services/devicemanagerservice/BUILD.gn | 1 + test_lite/device_manager_test.cpp | 15 ++------------- utils/BUILD.gn | 2 ++ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/services/devicemanagerservice/BUILD.gn b/services/devicemanagerservice/BUILD.gn index d27f08b0d..6ba24f4c8 100755 --- a/services/devicemanagerservice/BUILD.gn +++ b/services/devicemanagerservice/BUILD.gn @@ -42,6 +42,7 @@ if (defined(ohos_lite)) { "${common_path}/include/ipc/model", "${utils_path}/include", "${utils_path}/include/ipc/lite", + "${utils_path}/include/permission/lite", "${innerkits_path}/native_cpp/include", "${innerkits_path}/native_cpp/include/ipc", "${innerkits_path}/native_cpp/include/ipc/lite", diff --git a/test_lite/device_manager_test.cpp b/test_lite/device_manager_test.cpp index 7e60f67cd..abc537f33 100644 --- a/test_lite/device_manager_test.cpp +++ b/test_lite/device_manager_test.cpp @@ -296,20 +296,9 @@ int main(){ } else if (cmd == "UnInitDeviceManager") { UnInitDeviceManager(); } else if (cmd == "InputEncryptText") { - // std::string plainText = ""; - // std::cin >> plainText; - // int32_t outLen = 0; - // memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE); - // EncryptUtils::MbedtlsEncrypt((const uint8_t*)encryptText.c_str(), encryptText.size(), - // g_buf, encryptText.size(), &outLen); - LOGI("EncryptText:%s\n", g_buf); + LOGI("EncryptText:InputEncryptText unsupport."); } else if (cmd == "DecryptTexit") { - // int32_t outLen = 0; - // std::string encryptText = (const char*)g_buf; - // memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE); - // EncryptUtils::MbedtlsDecrypt((const uint8_t*)encryptText.c_str(), encryptText.size(), - // g_buf, encryptText.size(), &outLen); - LOGI("PlainText:%s\n", g_buf); + LOGI("EncryptText:DecryptTexit unsupport."); } else if (cmd == "Exit") { break; } else { diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 65737fcbf..9be9bf7ff 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -27,6 +27,7 @@ if (defined(ohos_lite)) { "${common_path}/include/ipc/model", "include", "include/ipc/lite", + "include/permission/lite", ] include_dirs += [ "//base/security/deviceauth/interfaces/innerkits", @@ -49,6 +50,7 @@ if (defined(ohos_lite)) { "src/dm_log.cpp", "src/dm_random.cpp", "src/ipc/lite/ipc_cmd_register.cpp", + "src/permission/lite/permission_manager.cpp", ] defines = [ "hI_LOG_ENABLE", -- Gitee