Signed-off-by: tangfan <tangfan5@huawei.com>
This commit is contained in:
tangfan 2023-11-11 02:05:19 +08:00
parent 9646131581
commit 4ede00f973
4 changed files with 83 additions and 87 deletions

View File

@ -16,54 +16,52 @@ import("//build/ohos_var.gni")
import("//foundation/deviceprofile/device_info_manager/deviceprofile.gni")
config("distributed_device_profile_common_config") {
visibility = [ ":*" ]
include_dirs = [
"include/interfaces",
"include/constants",
"include/utils",
"//third_party/json/include",
]
visibility = [ ":*" ]
include_dirs = [
"include/interfaces",
"include/constants",
"include/utils",
"//third_party/json/include",
]
}
ohos_shared_library("distributed_device_profile_common") {
install_enable = true
install_enable = true
sources = [
"src/interfaces/access_control_profile.cpp",
"src/interfaces/accessee.cpp",
"src/interfaces/accesser.cpp",
"src/interfaces/characteristic_profile.cpp",
"src/interfaces/device_profile.cpp",
"src/interfaces/profile_change_listener_proxy.cpp",
"src/interfaces/profile_change_listener_stub.cpp",
"src/interfaces/service_profile.cpp",
"src/interfaces/dp_subscribe_info.cpp",
"src/interfaces/sync_completed_callback_proxy.cpp",
"src/interfaces/sync_completed_callback_stub.cpp",
"src/interfaces/sync_options.cpp",
"src/interfaces/trust_device_profile.cpp",
"src/utils/ipc_utils.cpp",
"src/utils/profile_utils.cpp",
]
sources = [
"src/interfaces/access_control_profile.cpp",
"src/interfaces/accessee.cpp",
"src/interfaces/accesser.cpp",
"src/interfaces/characteristic_profile.cpp",
"src/interfaces/device_profile.cpp",
"src/interfaces/dp_subscribe_info.cpp",
"src/interfaces/profile_change_listener_proxy.cpp",
"src/interfaces/profile_change_listener_stub.cpp",
"src/interfaces/service_profile.cpp",
"src/interfaces/sync_completed_callback_proxy.cpp",
"src/interfaces/sync_completed_callback_stub.cpp",
"src/interfaces/sync_options.cpp",
"src/interfaces/trust_device_profile.cpp",
"src/utils/ipc_utils.cpp",
"src/utils/profile_utils.cpp",
]
public_configs = [
":distributed_device_profile_common_config"
]
public_configs = [ ":distributed_device_profile_common_config" ]
external_deps = [
"c_utils:utils",
"eventhandler:libeventhandler",
"hilog:libhilog",
"ipc:ipc_core",
"samgr:samgr_proxy",
"relational_store:native_rdb",
"init:libbegetutil",
"access_token:libaccesstoken_sdk",
"device_manager:devicemanagersdk",
"dmsfwk:common_sdk",
"safwk:system_ability_fwk"
]
external_deps = [
"access_token:libaccesstoken_sdk",
"c_utils:utils",
"device_manager:devicemanagersdk",
"dmsfwk:common_sdk",
"eventhandler:libeventhandler",
"hilog:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
"relational_store:native_rdb",
"safwk:system_ability_fwk",
"samgr:samgr_proxy",
]
part_name = "device_info_manager"
subsystem_name = "deviceprofile"
part_name = "device_info_manager"
subsystem_name = "deviceprofile"
}

View File

@ -81,7 +81,7 @@ bool IpcUtils::Marshalling(MessageParcel& parcel, const std::vector<Characterist
}
uint32_t size = charProfiles.size();
WRITE_HELPER_RET(parcel, Uint32, size, false);
for (const auto& profile : charProfile) {
for (const auto& profile : charProfiles) {
profile.Marshalling(parcel);
}
return true;

View File

@ -1,4 +1,4 @@
# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
# Copyright (c) 2021-2023 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
@ -18,55 +18,53 @@ import("//foundation/deviceprofile/device_info_manager/deviceprofile.gni")
config("device_info_manager_config") {
visibility = [ ":*" ]
include_dirs = [
"include",
"include/contentsensormanager",
"include/deviceprofilemanager",
"include/deviceprofilemanager/listener",
"include/dfx",
"include/permissionmanager",
"include/persistenceadapter",
"include/persistenceadapter/kvadapter",
"include/persistenceadapter/rdbadapter",
"include/subscribeprofilemanager",
"include/trustprofilemanager",
"include/utils",
"${device_profile_common}/include/constants",
"${device_profile_common}/include/interfaces",
"${device_profile_common}/include/utils",
"include",
"include/contentsensormanager",
"include/deviceprofilemanager",
"include/deviceprofilemanager/listener",
"include/dfx",
"include/permissionmanager",
"include/persistenceadapter",
"include/persistenceadapter/kvadapter",
"include/persistenceadapter/rdbadapter",
"include/subscribeprofilemanager",
"include/trustprofilemanager",
"include/utils",
"${device_profile_common}/include/constants",
"${device_profile_common}/include/interfaces",
"${device_profile_common}/include/utils",
]
}
ohos_shared_library("distributed_device_profile_svr") {
install_enable = true
sources = [
"src/contentsensormanager/collector.cpp",
"src/contentsensormanager/content_sensor_manager.cpp",
"src/contentsensormanager/device_info_collector.cpp",
"src/contentsensormanager/storage_info_collector.cpp",
"src/contentsensormanager/syscap_info_collector.cpp",
"src/contentsensormanager/system_info_collector.cpp",
"src/deviceprofilemanager/device_profile_manager.cpp",
"src/deviceprofilemanager/listener/kv_data_change_listener.cpp",
"src/deviceprofilemanager/listener/kv_store_death_recipient.cpp",
"src/deviceprofilemanager/listener/kv_sync_completed_listener.cpp",
"src/deviceprofilemanager/listener/sync_subscriber_death_recipient.cpp",
"src/dfx/device_profile_dumper.cpp",
"src/permissionmanager/permission_manager.cpp",
"src/persistenceadapter/kvadapter/kv_adapter.cpp",
"src/persistenceadapter/rdbadapter/rdb_adapter.cpp",
"src/subscribeprofilemanager/subscribe_profile_manager.cpp",
"src/trustprofilemanager/trust_profile_manager.cpp",
"src/utils/profile_cache.cpp",
"src/utils/event_handler_factory.cpp",
"src/distributed_device_profile_service_new.cpp",
"src/distributed_device_profile_stub_new.cpp"
"src/contentsensormanager/collector.cpp",
"src/contentsensormanager/content_sensor_manager.cpp",
"src/contentsensormanager/device_info_collector.cpp",
"src/contentsensormanager/storage_info_collector.cpp",
"src/contentsensormanager/syscap_info_collector.cpp",
"src/contentsensormanager/system_info_collector.cpp",
"src/deviceprofilemanager/device_profile_manager.cpp",
"src/deviceprofilemanager/listener/kv_data_change_listener.cpp",
"src/deviceprofilemanager/listener/kv_store_death_recipient.cpp",
"src/deviceprofilemanager/listener/kv_sync_completed_listener.cpp",
"src/deviceprofilemanager/listener/sync_subscriber_death_recipient.cpp",
"src/dfx/device_profile_dumper.cpp",
"src/distributed_device_profile_service_new.cpp",
"src/distributed_device_profile_stub_new.cpp",
"src/permissionmanager/permission_manager.cpp",
"src/persistenceadapter/kvadapter/kv_adapter.cpp",
"src/persistenceadapter/rdbadapter/rdb_adapter.cpp",
"src/subscribeprofilemanager/subscribe_profile_manager.cpp",
"src/trustprofilemanager/trust_profile_manager.cpp",
"src/utils/event_handler_factory.cpp",
"src/utils/profile_cache.cpp",
]
deps = [ "${device_profile_common}:distributed_device_profile_common" ]
configs = [
":device_info_manager_config"
]
configs = [ ":device_info_manager_config" ]
external_deps = [
"access_token:libaccesstoken_sdk",
@ -81,12 +79,12 @@ ohos_shared_library("distributed_device_profile_svr") {
"init:libbegetutil",
"ipc:ipc_core",
"kv_store:distributeddata_inner",
"relational_store:native_rdb",
"safwk:system_ability_fwk",
"samgr:samgr_proxy",
"syscap_codec:syscap_interface_shared",
"relational_store:native_rdb"
]
part_name = "device_info_manager"
subsystem_name = "deviceprofile"
}
}

View File

@ -180,7 +180,7 @@ int32_t DistributedDeviceProfileServiceNew::GetTrustDeviceProfile(const std::str
HILOGE("the caller is permission denied!");
return DP_PERMISSION_DENIED;
}
return TrustProfileManager::GetInstance().GetTrustDeviceProfile(trustDeviceProfile);
return TrustProfileManager::GetInstance().GetTrustDeviceProfile(deviceId, trustDeviceProfile);
}
int32_t DistributedDeviceProfileServiceNew::GetAllTrustDeviceProfile(std::vector<TrustDeviceProfile>& trustDeviceProfiles)