814 lines
30 KiB
Diff
814 lines
30 KiB
Diff
From 3ecd44499a662c42887d6349b17e5d06f49cc799 Mon Sep 17 00:00:00 2001
|
|
From: heppen <hepeng68@huawei.com>
|
|
Date: Sun, 25 Jun 2023 11:17:44 +0800
|
|
Subject: [PATCH] remove dependency
|
|
|
|
---
|
|
bundle.json | 3 +-
|
|
common/include/dm_constants.h | 6 ++--
|
|
common/src/dfx/standard/dm_hisysevent.cpp | 4 ++-
|
|
common/src/dfx/standard/dm_hitrace.cpp | 6 ++--
|
|
ext/BUILD.gn | 4 +--
|
|
ext/no_interaction_auth/BUILD.gn | 10 +++----
|
|
ext/pin_auth/BUILD.gn | 8 ++---
|
|
.../include/ability/dm_ability_manager.h | 4 +--
|
|
ext/pin_auth/include/standard/pin_auth_ui.h | 4 +--
|
|
ext/pin_auth/src/standard/pin_auth_ui.cpp | 15 ++++++++--
|
|
interfaces/inner_kits/native_cpp/BUILD.gn | 4 +--
|
|
.../native_cpp/include/dm_subscribe_info.h | 2 ++
|
|
services/implementation/BUILD.gn | 22 +++++++-------
|
|
.../include/config/json_config.h | 12 ++++----
|
|
.../include/device_manager_service_impl.h | 4 +--
|
|
.../src/authentication/dm_auth_manager.cpp | 3 +-
|
|
.../showconfirm/standard/show_confirm.cpp | 7 +++--
|
|
.../src/device_manager_service_impl.cpp | 30 +++++++++++++++----
|
|
.../devicestate/dm_device_state_manager.cpp | 8 ++---
|
|
services/service/BUILD.gn | 16 +++++-----
|
|
.../ipc/standard/ipc_server_listener.h | 4 ++-
|
|
.../src/device_manager_service_listener.cpp | 2 +-
|
|
.../src/ipc/standard/ipc_server_listener.cpp | 2 +-
|
|
utils/BUILD.gn | 6 ++--
|
|
24 files changed, 112 insertions(+), 74 deletions(-)
|
|
|
|
diff --git a/bundle.json b/bundle.json
|
|
index 5d6b784..bee412c 100644
|
|
--- a/bundle.json
|
|
+++ b/bundle.json
|
|
@@ -72,7 +72,8 @@
|
|
"device_manager_callback.h",
|
|
"dm_device_info.h",
|
|
"dm_publish_info.h",
|
|
- "dm_subscribe_info.h"
|
|
+ "dm_subscribe_info.h",
|
|
+ "dm_app_image_info.h"
|
|
],
|
|
"header_base": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include"
|
|
}
|
|
diff --git a/common/include/dm_constants.h b/common/include/dm_constants.h
|
|
index 263d6aa..8104c65 100755
|
|
--- a/common/include/dm_constants.h
|
|
+++ b/common/include/dm_constants.h
|
|
@@ -19,9 +19,9 @@
|
|
#include <string>
|
|
|
|
#ifdef __LP64__
|
|
-constexpr const char* LIB_LOAD_PATH = "/system/lib64/";
|
|
+constexpr const char* LIB_LOAD_PATH = "/usr/lib64/";
|
|
#else
|
|
-constexpr const char* LIB_LOAD_PATH = "/system/lib/";
|
|
+constexpr const char* LIB_LOAD_PATH = "/usr/lib/";
|
|
#endif
|
|
|
|
namespace OHOS {
|
|
@@ -120,4 +120,4 @@ constexpr const char* EVENT_INIT_CODE = "2";
|
|
constexpr uint32_t MAX_MESSAGE_LEN = 40 * 1024 * 1024;
|
|
} // namespace DistributedHardware
|
|
} // namespace OHOS
|
|
-#endif // OHOS_DM_CONSTANTS_H
|
|
\ No newline at end of file
|
|
+#endif // OHOS_DM_CONSTANTS_H
|
|
diff --git a/common/src/dfx/standard/dm_hisysevent.cpp b/common/src/dfx/standard/dm_hisysevent.cpp
|
|
index 4e9b297..9aba660 100644
|
|
--- a/common/src/dfx/standard/dm_hisysevent.cpp
|
|
+++ b/common/src/dfx/standard/dm_hisysevent.cpp
|
|
@@ -17,13 +17,14 @@
|
|
|
|
#include "dm_constants.h" // for DM_OK
|
|
#include "dm_log.h" // for LOGE
|
|
-#include "hisysevent.h" // for HiSysEvent, HiSysEvent::Domain, HiSysEvent...
|
|
+//#include "hisysevent.h" // for HiSysEvent, HiSysEvent::Domain, HiSysEvent...
|
|
#include "unistd.h" // for getpid, getuid
|
|
|
|
namespace OHOS {
|
|
namespace DistributedHardware {
|
|
void SysEventWrite(const std::string &status, int32_t eventType, const std::string &msg)
|
|
{
|
|
+/*
|
|
int32_t res = OHOS::HiviewDFX::HiSysEvent::Write(
|
|
OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_DEVICE_MANAGER,
|
|
status.c_str(),
|
|
@@ -34,6 +35,7 @@ void SysEventWrite(const std::string &status, int32_t eventType, const std::stri
|
|
if (res != DM_OK) {
|
|
LOGE("%s Write HiSysEvent error, res:%d", status.c_str(), res);
|
|
}
|
|
+*/
|
|
}
|
|
} // namespace DistributedHardware
|
|
} // namespace OHOS
|
|
diff --git a/common/src/dfx/standard/dm_hitrace.cpp b/common/src/dfx/standard/dm_hitrace.cpp
|
|
index 1bbe65f..50fa4c5 100644
|
|
--- a/common/src/dfx/standard/dm_hitrace.cpp
|
|
+++ b/common/src/dfx/standard/dm_hitrace.cpp
|
|
@@ -13,18 +13,18 @@
|
|
* limitations under the License.
|
|
*/
|
|
#include "dm_hitrace.h"
|
|
-#include "hitrace_meter.h"
|
|
+//#include "hitrace_meter.h"
|
|
|
|
namespace OHOS {
|
|
namespace DistributedHardware {
|
|
void DmTraceStart(const std::string &msg)
|
|
{
|
|
- StartTrace(HITRACE_TAG_DEVICE_MANAGER, msg);
|
|
+ //StartTrace(HITRACE_TAG_DEVICE_MANAGER, msg);
|
|
}
|
|
|
|
void DmTraceEnd()
|
|
{
|
|
- FinishTrace(HITRACE_TAG_DEVICE_MANAGER);
|
|
+ //FinishTrace(HITRACE_TAG_DEVICE_MANAGER);
|
|
}
|
|
} // namespace DistributedHardware
|
|
} // namespace OHOS
|
|
diff --git a/ext/BUILD.gn b/ext/BUILD.gn
|
|
index 03033ec..23b3c97 100644
|
|
--- a/ext/BUILD.gn
|
|
+++ b/ext/BUILD.gn
|
|
@@ -16,11 +16,11 @@ import("//foundation/distributedhardware/device_manager/device_manager.gni")
|
|
|
|
group("ext_modules") {
|
|
deps = []
|
|
- if (support_jsapi) {
|
|
+ #if (support_jsapi) {
|
|
if (device_manager_no_interaction_auth) {
|
|
deps += [ "./no_interaction_auth:devicemanagerext_no_interaction_auth" ]
|
|
} else {
|
|
deps += [ "./pin_auth:devicemanagerext_pin_auth" ]
|
|
}
|
|
- }
|
|
+ #}
|
|
}
|
|
diff --git a/ext/no_interaction_auth/BUILD.gn b/ext/no_interaction_auth/BUILD.gn
|
|
index 231e60e..5d75aa4 100644
|
|
--- a/ext/no_interaction_auth/BUILD.gn
|
|
+++ b/ext/no_interaction_auth/BUILD.gn
|
|
@@ -57,12 +57,12 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
sources = [
|
|
- "src/ability/standard/dm_ability_manager.cpp",
|
|
+ #"src/ability/standard/dm_ability_manager.cpp",
|
|
"src/no_interaction_auth.cpp",
|
|
]
|
|
|
|
deps = [
|
|
- "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
+ #"${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
"${ability_runtime_services_path}/abilitymgr:abilityms",
|
|
"${innerkits_path}/native_cpp:devicemanagersdk",
|
|
"${utils_path}:devicemanagerutils",
|
|
@@ -72,12 +72,12 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
external_deps = [
|
|
- "ability_base:want",
|
|
+ #"ability_base:want",
|
|
"bundle_framework:appexecfwk_base",
|
|
"bundle_framework:appexecfwk_core",
|
|
"c_utils:utils",
|
|
- "common_event_service:cesfwk_core",
|
|
- "common_event_service:cesfwk_innerkits",
|
|
+ #"common_event_service:cesfwk_core",
|
|
+ #"common_event_service:cesfwk_innerkits",
|
|
"dsoftbus:softbus_client",
|
|
"hiviewdfx_hilog_native:libhilog",
|
|
"init:libbeget_proxy",
|
|
diff --git a/ext/pin_auth/BUILD.gn b/ext/pin_auth/BUILD.gn
|
|
index d49e4f4..a5ab558 100644
|
|
--- a/ext/pin_auth/BUILD.gn
|
|
+++ b/ext/pin_auth/BUILD.gn
|
|
@@ -57,7 +57,7 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
sources = [
|
|
- "src/ability/lite/dm_ability_manager.cpp",
|
|
+ #"src/ability/lite/dm_ability_manager.cpp",
|
|
"src/lite/pin_auth_ui.cpp",
|
|
"src/pin_auth.cpp",
|
|
]
|
|
@@ -128,19 +128,19 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
sources = [
|
|
- "src/ability/standard/dm_ability_manager.cpp",
|
|
+ #"src/ability/standard/dm_ability_manager.cpp",
|
|
"src/pin_auth.cpp",
|
|
"src/standard/pin_auth_ui.cpp",
|
|
]
|
|
|
|
deps = [
|
|
- "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
+ #"${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
"${innerkits_path}/native_cpp:devicemanagersdk",
|
|
"//foundation/distributedhardware/device_manager/services/implementation:devicemanagerserviceimpl",
|
|
]
|
|
|
|
external_deps = [
|
|
- "ability_base:want",
|
|
+ #"ability_base:want",
|
|
"init:libbegetutil",
|
|
]
|
|
|
|
diff --git a/ext/pin_auth/include/ability/dm_ability_manager.h b/ext/pin_auth/include/ability/dm_ability_manager.h
|
|
index 83a62f2..34c8382 100644
|
|
--- a/ext/pin_auth/include/ability/dm_ability_manager.h
|
|
+++ b/ext/pin_auth/include/ability/dm_ability_manager.h
|
|
@@ -18,7 +18,7 @@
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
-#include "want.h"
|
|
+//#include "want.h"
|
|
|
|
namespace OHOS {
|
|
namespace DistributedHardware {
|
|
@@ -37,7 +37,7 @@ enum UiAction {
|
|
|
|
class DmAbilityManager {
|
|
public:
|
|
- AbilityStatus StartAbility(AAFwk::Want &want);
|
|
+ //AbilityStatus StartAbility(AAFwk::Want &want);
|
|
};
|
|
} // namespace DistributedHardware
|
|
} // namespace OHOS
|
|
diff --git a/ext/pin_auth/include/standard/pin_auth_ui.h b/ext/pin_auth/include/standard/pin_auth_ui.h
|
|
index aa33b20..c8e219f 100644
|
|
--- a/ext/pin_auth/include/standard/pin_auth_ui.h
|
|
+++ b/ext/pin_auth/include/standard/pin_auth_ui.h
|
|
@@ -20,7 +20,7 @@
|
|
|
|
#include "dm_auth_manager.h"
|
|
#include "dm_ability_manager.h"
|
|
-#include "want.h"
|
|
+//#include "want.h"
|
|
|
|
namespace OHOS {
|
|
namespace DistributedHardware {
|
|
@@ -32,4 +32,4 @@ public:
|
|
};
|
|
} // namespace DistributedHardware
|
|
} // namespace OHOS
|
|
-#endif // OHOS_DM_PIN_AUTH_UI_H
|
|
\ No newline at end of file
|
|
+#endif // OHOS_DM_PIN_AUTH_UI_H
|
|
diff --git a/ext/pin_auth/src/standard/pin_auth_ui.cpp b/ext/pin_auth/src/standard/pin_auth_ui.cpp
|
|
index 65af67a..365ae7e 100644
|
|
--- a/ext/pin_auth/src/standard/pin_auth_ui.cpp
|
|
+++ b/ext/pin_auth/src/standard/pin_auth_ui.cpp
|
|
@@ -12,7 +12,7 @@
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-
|
|
+#include <iostream>
|
|
#include "pin_auth_ui.h"
|
|
|
|
#include "dm_ability_manager.h"
|
|
@@ -36,6 +36,8 @@ int32_t PinAuthUi::ShowPinDialog(int32_t code, std::shared_ptr<DmAuthManager> au
|
|
LOGE("authManager is null");
|
|
return ERR_DM_FAILED;
|
|
}
|
|
+ std::cout << "PinCode:%d" << std::to_string(code) << std::endl;
|
|
+ /*
|
|
std::shared_ptr<DmAbilityManager> dmAbilityMgr = std::make_shared<DmAbilityManager>();
|
|
AAFwk::Want want;
|
|
want.SetParam("PinCode", std::to_string(code));
|
|
@@ -50,7 +52,7 @@ int32_t PinAuthUi::ShowPinDialog(int32_t code, std::shared_ptr<DmAuthManager> au
|
|
if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) {
|
|
LOGE("ShowConfirm::start ui service fail");
|
|
return ERR_DM_FAILED;
|
|
- }
|
|
+ }*/
|
|
LOGI("ShowPinDialog end");
|
|
return DM_OK;
|
|
}
|
|
@@ -62,6 +64,13 @@ int32_t PinAuthUi::InputPinDialog(std::shared_ptr<DmAuthManager> authManager)
|
|
LOGE("authManager is null");
|
|
return ERR_DM_FAILED;
|
|
}
|
|
+
|
|
+ int code;
|
|
+ std::cout << "Input PinCode:" << std::endl;
|
|
+ std::cin >> code ;
|
|
+ authManager->OnUserOperation(5,std::to_string(code));
|
|
+
|
|
+ /*
|
|
std::shared_ptr<DmAbilityManager> dmAbilityMgr = std::make_shared<DmAbilityManager>();
|
|
|
|
AAFwk::Want want;
|
|
@@ -77,7 +86,7 @@ int32_t PinAuthUi::InputPinDialog(std::shared_ptr<DmAuthManager> authManager)
|
|
if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) {
|
|
LOGE("ShowConfirm::start ui service success");
|
|
return ERR_DM_FAILED;
|
|
- }
|
|
+ }*/
|
|
LOGI("InputPinDialog end");
|
|
return DM_OK;
|
|
}
|
|
diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn
|
|
index d572656..a8788e9 100644
|
|
--- a/interfaces/inner_kits/native_cpp/BUILD.gn
|
|
+++ b/interfaces/inner_kits/native_cpp/BUILD.gn
|
|
@@ -149,8 +149,8 @@ if (defined(ohos_lite)) {
|
|
|
|
external_deps = [
|
|
"c_utils:utils",
|
|
- "hisysevent_native:libhisysevent",
|
|
- "hitrace_native:hitrace_meter",
|
|
+ #"hisysevent_native:libhisysevent",
|
|
+ #"hitrace_native:hitrace_meter",
|
|
"hiviewdfx_hilog_native:libhilog",
|
|
"ipc:ipc_core",
|
|
"samgr:samgr_proxy",
|
|
diff --git a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h
|
|
index 603e242..054bfd3 100644
|
|
--- a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h
|
|
+++ b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h
|
|
@@ -17,6 +17,8 @@
|
|
#define OHOS_DM_SUBSCRIBE_INFO_H
|
|
|
|
#include <stdbool.h>
|
|
+#include <stdlib.h>
|
|
+#include <stdint.h>
|
|
|
|
#define DM_MAX_DEVICE_CAPABILITY_LEN 65
|
|
|
|
diff --git a/services/implementation/BUILD.gn b/services/implementation/BUILD.gn
|
|
index 126232e..faf0951 100644
|
|
--- a/services/implementation/BUILD.gn
|
|
+++ b/services/implementation/BUILD.gn
|
|
@@ -76,7 +76,7 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
sources = [
|
|
- "${servicesimpl_path}/src/ability/lite/dm_ability_manager.cpp",
|
|
+ #"${servicesimpl_path}/src/ability/lite/dm_ability_manager.cpp",
|
|
"${servicesimpl_path}/src/adapter/standard/dm_adapter_manager.cpp",
|
|
"${servicesimpl_path}/src/authentication/auth_message_processor.cpp",
|
|
"${servicesimpl_path}/src/authentication/auth_request_state.cpp",
|
|
@@ -127,10 +127,10 @@ if (defined(ohos_lite)) {
|
|
]
|
|
}
|
|
}
|
|
-} else if (!support_jsapi) {
|
|
- group("devicemanagerserviceimpl") {
|
|
- deps = []
|
|
- }
|
|
+#} else if (!support_jsapi) {
|
|
+# group("devicemanagerserviceimpl") {
|
|
+# deps = []
|
|
+# }
|
|
} else {
|
|
config("devicemanagerserviceimpl_config") {
|
|
include_dirs = [
|
|
@@ -174,7 +174,7 @@ if (defined(ohos_lite)) {
|
|
|
|
ohos_shared_library("devicemanagerserviceimpl") {
|
|
sources = [
|
|
- "src/ability/standard/dm_ability_manager.cpp",
|
|
+ #"src/ability/standard/dm_ability_manager.cpp",
|
|
"src/adapter/standard/dm_adapter_manager.cpp",
|
|
"src/authentication/auth_message_processor.cpp",
|
|
"src/authentication/auth_request_state.cpp",
|
|
@@ -183,7 +183,7 @@ if (defined(ohos_lite)) {
|
|
"src/authentication/showconfirm/standard/show_confirm.cpp",
|
|
"src/config/dm_config_manager.cpp",
|
|
"src/credential/dm_credential_manager.cpp",
|
|
- "src/dependency/commonevent/dm_common_event_manager.cpp",
|
|
+ #"src/dependency/commonevent/dm_common_event_manager.cpp",
|
|
"src/dependency/hichain/hichain_connector.cpp",
|
|
"src/dependency/multipleuser/multiple_user_connector.cpp",
|
|
"src/dependency/softbus/softbus_connector.cpp",
|
|
@@ -205,7 +205,7 @@ if (defined(ohos_lite)) {
|
|
]
|
|
|
|
deps = [
|
|
- "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
+ #"${ability_runtime_innerkits_path}/ability_manager:ability_manager",
|
|
"${innerkits_path}/native_cpp:devicemanagersdk",
|
|
"${utils_path}:devicemanagerutils",
|
|
"//base/security/device_auth/services:deviceauth_sdk",
|
|
@@ -220,10 +220,10 @@ if (defined(ohos_lite)) {
|
|
}
|
|
|
|
external_deps = [
|
|
- "ability_base:want",
|
|
+ #"ability_base:want",
|
|
"c_utils:utils",
|
|
- "common_event_service:cesfwk_core",
|
|
- "common_event_service:cesfwk_innerkits",
|
|
+ #"common_event_service:cesfwk_core",
|
|
+ #"common_event_service:cesfwk_innerkits",
|
|
"dsoftbus:softbus_client",
|
|
"init:libbegetutil",
|
|
"ipc:ipc_core",
|
|
diff --git a/services/implementation/include/config/json_config.h b/services/implementation/include/config/json_config.h
|
|
index f9598fa..59d061d 100644
|
|
--- a/services/implementation/include/config/json_config.h
|
|
+++ b/services/implementation/include/config/json_config.h
|
|
@@ -29,7 +29,7 @@ const std::string adapterJsonConfigString =
|
|
"version": "1.0",
|
|
"funcName": "CreateCryptoAdapterObject",
|
|
"soName": "libdevicemanager_crypto_adapter.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
},
|
|
{
|
|
"name": "device_decision",
|
|
@@ -37,7 +37,7 @@ const std::string adapterJsonConfigString =
|
|
"version": "1.0",
|
|
"funcName": "CreateDeviceDecisionObject",
|
|
"soName": "libdevicemanagerext_decision.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
}
|
|
]
|
|
})";
|
|
@@ -52,7 +52,7 @@ const std::string authJsonConfigString =
|
|
"authType": 1,
|
|
"funcName": "CreatePinAuthObject",
|
|
"soName": "libdevicemanagerext_pin_auth.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
},
|
|
{
|
|
"name": "QRcode_auth",
|
|
@@ -61,7 +61,7 @@ const std::string authJsonConfigString =
|
|
"authType": 2,
|
|
"funcName": "CreateQRcodeAuthObject",
|
|
"soName": "libdevicemanager_qrcodeauth.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
},
|
|
{
|
|
"name": "nfc_auth",
|
|
@@ -70,7 +70,7 @@ const std::string authJsonConfigString =
|
|
"authType": 3,
|
|
"funcName": "CreateNfcAuthObject",
|
|
"soName": "libdevicemanager_nfcauth.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
},
|
|
{
|
|
"name": "no_interaction_auth",
|
|
@@ -79,7 +79,7 @@ const std::string authJsonConfigString =
|
|
"authType": 4,
|
|
"funcName": "CreatePinAuthObject",
|
|
"soName": "libdevicemanagerext_no_interaction_auth.z.so",
|
|
- "soPath": "/system/lib/"
|
|
+ "soPath": "/usr/lib64/"
|
|
}
|
|
]
|
|
})";
|
|
diff --git a/services/implementation/include/device_manager_service_impl.h b/services/implementation/include/device_manager_service_impl.h
|
|
index 0eec829..b1064f7 100644
|
|
--- a/services/implementation/include/device_manager_service_impl.h
|
|
+++ b/services/implementation/include/device_manager_service_impl.h
|
|
@@ -21,7 +21,7 @@
|
|
|
|
#include "dm_ability_manager.h"
|
|
#include "dm_auth_manager.h"
|
|
-#include "dm_common_event_manager.h"
|
|
+//#include "dm_common_event_manager.h"
|
|
#include "dm_credential_manager.h"
|
|
#include "dm_device_info.h"
|
|
#include "dm_device_state_manager.h"
|
|
@@ -100,7 +100,7 @@ private:
|
|
std::shared_ptr<DmAbilityManager> abilityMgr_;
|
|
std::shared_ptr<HiChainConnector> hiChainConnector_;
|
|
std::shared_ptr<DmCredentialManager> credentialMgr_;
|
|
- std::shared_ptr<DmCommonEventManager> commonEventManager_;
|
|
+ //std::shared_ptr<DmCommonEventManager> commonEventManager_;
|
|
};
|
|
|
|
using CreateDMServiceFuncPtr = IDeviceManagerServiceImpl *(*)(void);
|
|
diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp
|
|
index 4b0fbd9..5a23b4e 100644
|
|
--- a/services/implementation/src/authentication/dm_auth_manager.cpp
|
|
+++ b/services/implementation/src/authentication/dm_auth_manager.cpp
|
|
@@ -443,6 +443,7 @@ void DmAuthManager::StartNegotiate(const int32_t &sessionId)
|
|
LOGI("DmAuthManager::StartNegotiate session id is %d", sessionId);
|
|
char localDeviceId[DEVICE_UUID_LENGTH] = {0};
|
|
GetDevUdid(localDeviceId, DEVICE_UUID_LENGTH);
|
|
+
|
|
authRequestContext_->localDeviceId = localDeviceId;
|
|
authResponseContext_->localDeviceId = localDeviceId;
|
|
authResponseContext_->reply = ERR_DM_AUTH_REJECT;
|
|
@@ -940,4 +941,4 @@ bool DmAuthManager::IsIdenticalAccount()
|
|
return true;
|
|
}
|
|
} // namespace DistributedHardware
|
|
-} // namespace OHOS
|
|
\ No newline at end of file
|
|
+} // namespace OHOS
|
|
diff --git a/services/implementation/src/authentication/showconfirm/standard/show_confirm.cpp b/services/implementation/src/authentication/showconfirm/standard/show_confirm.cpp
|
|
index 37ec3b5..68d6e77 100644
|
|
--- a/services/implementation/src/authentication/showconfirm/standard/show_confirm.cpp
|
|
+++ b/services/implementation/src/authentication/showconfirm/standard/show_confirm.cpp
|
|
@@ -34,6 +34,9 @@ void ShowConfirm::ShowConfirmDialog(const std::string ¶ms, std::shared_ptr<D
|
|
std::shared_ptr<DmAbilityManager> dmAbilityMgr)
|
|
{
|
|
LOGI("ShowConfirm hap start");
|
|
+ LOGI("TEST CONFIRM OK..");
|
|
+ authManager->OnUserOperation(0,params);
|
|
+ /*
|
|
if (dmAbilityMgr == nullptr) {
|
|
LOGE("ShowConfirm::dmAbilityManager is null");
|
|
return;
|
|
@@ -42,8 +45,8 @@ void ShowConfirm::ShowConfirmDialog(const std::string ¶ms, std::shared_ptr<D
|
|
if (status != AbilityStatus::ABILITY_STATUS_SUCCESS) {
|
|
LOGE("ShowConfirm::start ui service fail");
|
|
return;
|
|
- }
|
|
+ }*/
|
|
LOGI("ShowConfirm hap end");
|
|
}
|
|
} // namespace DistributedHardware
|
|
-} // namespace OHOS
|
|
\ No newline at end of file
|
|
+} // namespace OHOS
|
|
diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp
|
|
index a78109c..c3a29a0 100644
|
|
--- a/services/implementation/src/device_manager_service_impl.cpp
|
|
+++ b/services/implementation/src/device_manager_service_impl.cpp
|
|
@@ -23,11 +23,11 @@
|
|
#include "dm_log.h"
|
|
#include "multiple_user_connector.h"
|
|
#include "permission_manager.h"
|
|
-#if !(defined(__LITEOS_M__) || defined(LITE_DEVICE))
|
|
-#include "dm_common_event_manager.h"
|
|
-#include "common_event_support.h"
|
|
-using namespace OHOS::EventFwk;
|
|
-#endif
|
|
+//#if !(defined(__LITEOS_M__) || defined(LITE_DEVICE))
|
|
+//#include "dm_common_event_manager.h"
|
|
+//#include "common_event_support.h"
|
|
+//using namespace OHOS::EventFwk;
|
|
+//#endif
|
|
|
|
namespace OHOS {
|
|
namespace DistributedHardware {
|
|
@@ -74,6 +74,7 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr<IDeviceManage
|
|
LOGI("get current account user id success");
|
|
MultipleUserConnector::SetSwitchOldUserId(userId);
|
|
}
|
|
+/*
|
|
#if !(defined(__LITEOS_M__) || defined(LITE_DEVICE))
|
|
if (commonEventManager_ == nullptr) {
|
|
commonEventManager_ = std::make_shared<DmCommonEventManager>();
|
|
@@ -84,6 +85,7 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr<IDeviceManage
|
|
LOGI("subscribe service user switch common event success");
|
|
}
|
|
#endif
|
|
+*/
|
|
LOGI("Init success, singleton initialized");
|
|
return DM_OK;
|
|
}
|
|
@@ -91,9 +93,11 @@ int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr<IDeviceManage
|
|
void DeviceManagerServiceImpl::Release()
|
|
{
|
|
LOGI("DeviceManagerServiceImpl Release");
|
|
+/*
|
|
#if !(defined(__LITEOS_M__) || defined(LITE_DEVICE))
|
|
commonEventManager_ = nullptr;
|
|
#endif
|
|
+*/
|
|
softbusConnector_->GetSoftbusSession()->UnRegisterSessionCallback();
|
|
hiChainConnector_->UnRegisterHiChainCallback();
|
|
authMgr_ = nullptr;
|
|
@@ -108,10 +112,12 @@ void DeviceManagerServiceImpl::Release()
|
|
int32_t DeviceManagerServiceImpl::StartDeviceDiscovery(const std::string &pkgName, const DmSubscribeInfo &subscribeInfo,
|
|
const std::string &extra)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty()) {
|
|
LOGE("StartDeviceDiscovery failed, pkgName is empty");
|
|
return ERR_DM_INPUT_PARA_INVALID;
|
|
@@ -121,10 +127,12 @@ int32_t DeviceManagerServiceImpl::StartDeviceDiscovery(const std::string &pkgNam
|
|
|
|
int32_t DeviceManagerServiceImpl::StopDeviceDiscovery(const std::string &pkgName, uint16_t subscribeId)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty()) {
|
|
LOGE("StopDeviceDiscovery failed, pkgName is empty");
|
|
return ERR_DM_INPUT_PARA_INVALID;
|
|
@@ -134,10 +142,12 @@ int32_t DeviceManagerServiceImpl::StopDeviceDiscovery(const std::string &pkgName
|
|
|
|
int32_t DeviceManagerServiceImpl::PublishDeviceDiscovery(const std::string &pkgName, const DmPublishInfo &publishInfo)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty()) {
|
|
LOGE("PublishDeviceDiscovery failed, pkgName is empty");
|
|
return ERR_DM_INPUT_PARA_INVALID;
|
|
@@ -147,10 +157,12 @@ int32_t DeviceManagerServiceImpl::PublishDeviceDiscovery(const std::string &pkgN
|
|
|
|
int32_t DeviceManagerServiceImpl::UnPublishDeviceDiscovery(const std::string &pkgName, int32_t publishId)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty()) {
|
|
LOGE("UnPublishDeviceDiscovery failed, pkgName is empty");
|
|
return ERR_DM_INPUT_PARA_INVALID;
|
|
@@ -161,10 +173,12 @@ int32_t DeviceManagerServiceImpl::UnPublishDeviceDiscovery(const std::string &pk
|
|
int32_t DeviceManagerServiceImpl::AuthenticateDevice(const std::string &pkgName, int32_t authType,
|
|
const std::string &deviceId, const std::string &extra)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty() || deviceId.empty()) {
|
|
LOGE("DeviceManagerServiceImpl::AuthenticateDevice failed, pkgName is %s, deviceId is %s, extra is %s",
|
|
pkgName.c_str(), GetAnonyString(deviceId).c_str(), extra.c_str());
|
|
@@ -175,10 +189,12 @@ int32_t DeviceManagerServiceImpl::AuthenticateDevice(const std::string &pkgName,
|
|
|
|
int32_t DeviceManagerServiceImpl::UnAuthenticateDevice(const std::string &pkgName, const std::string &deviceId)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
if (pkgName.empty() || deviceId.empty()) {
|
|
LOGE("DeviceManagerServiceImpl::AuthenticateDevice failed, pkgName is %s, deviceId is %s",
|
|
pkgName.c_str(), GetAnonyString(deviceId).c_str());
|
|
@@ -189,10 +205,12 @@ int32_t DeviceManagerServiceImpl::UnAuthenticateDevice(const std::string &pkgNam
|
|
|
|
int32_t DeviceManagerServiceImpl::VerifyAuthentication(const std::string &authParam)
|
|
{
|
|
+/*
|
|
if (!PermissionManager::GetInstance().CheckPermission()) {
|
|
LOGI("The caller does not have permission to call");
|
|
return ERR_DM_NO_PERMISSION;
|
|
}
|
|
+*/
|
|
return authMgr_->VerifyAuthentication(authParam);
|
|
}
|
|
|
|
@@ -391,7 +409,7 @@ int32_t DeviceManagerServiceImpl::NotifyEvent(const std::string &pkgName, const
|
|
|
|
void DeviceManagerServiceImpl::LoadHardwareFwkService()
|
|
{
|
|
- DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk();
|
|
+ //DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk();
|
|
}
|
|
|
|
extern "C" IDeviceManagerServiceImpl *CreateDMServiceObject(void)
|
|
diff --git a/services/implementation/src/devicestate/dm_device_state_manager.cpp b/services/implementation/src/devicestate/dm_device_state_manager.cpp
|
|
index 26f72db..b9571e1 100644
|
|
--- a/services/implementation/src/devicestate/dm_device_state_manager.cpp
|
|
+++ b/services/implementation/src/devicestate/dm_device_state_manager.cpp
|
|
@@ -18,7 +18,7 @@
|
|
#include "dm_adapter_manager.h"
|
|
#include "dm_anonymous.h"
|
|
#include "dm_constants.h"
|
|
-#include "dm_distributed_hardware_load.h"
|
|
+//#include "dm_distributed_hardware_load.h"
|
|
#include "dm_log.h"
|
|
|
|
namespace OHOS {
|
|
@@ -29,7 +29,7 @@ DmDeviceStateManager::DmDeviceStateManager(std::shared_ptr<SoftbusConnector> sof
|
|
std::shared_ptr<IDeviceManagerServiceListener> listener, std::shared_ptr<HiChainConnector> hiChainConnector)
|
|
: softbusConnector_(softbusConnector), listener_(listener), hiChainConnector_(hiChainConnector)
|
|
{
|
|
- decisionSoName_ = "libdevicemanagerext_decision.z.so";
|
|
+ decisionSoName_ = "libdevicemanagerext_decision.so";
|
|
StartEventThread();
|
|
LOGI("DmDeviceStateManager constructor");
|
|
}
|
|
@@ -192,7 +192,7 @@ void DmDeviceStateManager::OnDbReady(const std::string &pkgName, const std::stri
|
|
}
|
|
saveInfo = iter->second;
|
|
}
|
|
- DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk();
|
|
+ //DmDistributedHardwareLoad::GetInstance().LoadDistributedHardwareFwk();
|
|
if (listener_ != nullptr) {
|
|
DmDeviceState state = DEVICE_INFO_READY;
|
|
listener_->OnDeviceStateChange(pkgName, state, saveInfo);
|
|
@@ -380,4 +380,4 @@ int32_t DmDeviceStateManager::ProcNotifyEvent(const std::string &pkgName, const
|
|
return AddTask(std::make_shared<NotifyEvent>(eventId, deviceId));
|
|
}
|
|
} // namespace DistributedHardware
|
|
-} // namespace OHOS
|
|
\ No newline at end of file
|
|
+} // namespace OHOS
|
|
diff --git a/services/service/BUILD.gn b/services/service/BUILD.gn
|
|
index bb353c1..3714eab 100644
|
|
--- a/services/service/BUILD.gn
|
|
+++ b/services/service/BUILD.gn
|
|
@@ -112,10 +112,10 @@ if (defined(ohos_lite)) {
|
|
"//third_party/mbedtls",
|
|
]
|
|
|
|
- external_deps = [
|
|
- "hisysevent_native:libhisysevent",
|
|
- "hitrace_native:hitrace_meter",
|
|
- ]
|
|
+ #external_deps = [
|
|
+ # "hisysevent_native:libhisysevent",
|
|
+ # "hitrace_native:hitrace_meter",
|
|
+ #]
|
|
}
|
|
} else {
|
|
executable("devicemanagerservice") {
|
|
@@ -180,10 +180,10 @@ if (defined(ohos_lite)) {
|
|
]
|
|
}
|
|
}
|
|
-} else if (!support_jsapi) {
|
|
- group("devicemanagerservice") {
|
|
- deps = []
|
|
- }
|
|
+#} else if (!support_jsapi) {
|
|
+# group("devicemanagerservice") {
|
|
+# deps = []
|
|
+# }
|
|
} else {
|
|
config("devicemanagerservice_config") {
|
|
include_dirs = [
|
|
diff --git a/services/service/include/ipc/standard/ipc_server_listener.h b/services/service/include/ipc/standard/ipc_server_listener.h
|
|
index 0ff7bb8..abfa0fc 100644
|
|
--- a/services/service/include/ipc/standard/ipc_server_listener.h
|
|
+++ b/services/service/include/ipc/standard/ipc_server_listener.h
|
|
@@ -17,7 +17,9 @@
|
|
#define OHOS_DM_IPC_SERVER_LISTENER_H
|
|
|
|
#include <cstdint>
|
|
-
|
|
+#include <stdlib.h>
|
|
+#include <stdint.h>
|
|
+#include <memory>
|
|
#include "ipc_req.h"
|
|
#include "ipc_rsp.h"
|
|
|
|
diff --git a/services/service/src/device_manager_service_listener.cpp b/services/service/src/device_manager_service_listener.cpp
|
|
index 567b427..993b820 100644
|
|
--- a/services/service/src/device_manager_service_listener.cpp
|
|
+++ b/services/service/src/device_manager_service_listener.cpp
|
|
@@ -12,7 +12,7 @@
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-
|
|
+#include <memory>
|
|
#include "device_manager_service_listener.h"
|
|
|
|
#include "dm_constants.h"
|
|
diff --git a/services/service/src/ipc/standard/ipc_server_listener.cpp b/services/service/src/ipc/standard/ipc_server_listener.cpp
|
|
index 513b1fd..74137d0 100644
|
|
--- a/services/service/src/ipc/standard/ipc_server_listener.cpp
|
|
+++ b/services/service/src/ipc/standard/ipc_server_listener.cpp
|
|
@@ -12,7 +12,7 @@
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-
|
|
+#include <memory>
|
|
#include "ipc_server_listener.h"
|
|
|
|
#include "dm_constants.h"
|
|
diff --git a/utils/BUILD.gn b/utils/BUILD.gn
|
|
index 0d231c7..acd5697 100644
|
|
--- a/utils/BUILD.gn
|
|
+++ b/utils/BUILD.gn
|
|
@@ -181,10 +181,10 @@ if (defined(ohos_lite)) {
|
|
deps = [ "//third_party/mbedtls:mbedtls_shared" ]
|
|
|
|
external_deps = [
|
|
- "access_token:libaccesstoken_sdk",
|
|
+ #"access_token:libaccesstoken_sdk",
|
|
"c_utils:utils",
|
|
- "hisysevent_native:libhisysevent",
|
|
- "hitrace_native:hitrace_meter",
|
|
+ #"hisysevent_native:libhisysevent",
|
|
+ #"hitrace_native:hitrace_meter",
|
|
"hiviewdfx_hilog_native:libhilog",
|
|
"ipc:ipc_core",
|
|
"samgr:samgr_proxy",
|
|
--
|
|
2.33.0
|
|
|