diff --git a/services/distributeddataservice/adapter/account/src/account_delegate_impl.h b/services/distributeddataservice/adapter/account/src/account_delegate_impl.h index e8fc5d5c3b1129d34fac04a1199621253cffef0a..86874e0e12e1edb667d627c31f4f9ef7b481ace5 100644 --- a/services/distributeddataservice/adapter/account/src/account_delegate_impl.h +++ b/services/distributeddataservice/adapter/account/src/account_delegate_impl.h @@ -19,7 +19,7 @@ #include #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "concurrent_map.h" #include "log_print.h" diff --git a/services/distributeddataservice/adapter/communicator/BUILD.gn b/services/distributeddataservice/adapter/communicator/BUILD.gn index ff2d7cf867aa05e5a754f4c4459cdb9c006b81dc..9cb388498e0dc04d1f294934ecc7b6b3dfdac3e0 100755 --- a/services/distributeddataservice/adapter/communicator/BUILD.gn +++ b/services/distributeddataservice/adapter/communicator/BUILD.gn @@ -12,6 +12,11 @@ # limitations under the License. import("//build/ohos.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") + +config("module_public_config") { + visibility = [ ":*" ] + include_dirs = [ "${data_service_path}/adapter/include/communicator" ] +} ohos_source_set("distributeddata_communicator") { branch_protector_ret = "pac_ret" sanitize = { @@ -42,19 +47,15 @@ ohos_source_set("distributeddata_communicator") { ] include_dirs = [ - "../include/communicator", - "../include/utils", - "${data_service_path}/adapter/include/communicator", - "${data_service_path}/framework/include/dfx", - "${data_service_path}/framework/include/utils", + "${data_service_path}/adapter/include/utils", ] cflags_cc = [ "-fvisibility=hidden" ] + public_configs = [ ":module_public_config" ] deps = [ "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", - "../dfx:distributeddata_dfx", ] external_deps = [ diff --git a/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.cpp b/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.cpp index 022f303dbd99ac453ee228bfd1f1ad03e60a98a3..352f2edb6a49c70bc7ac173f4bb754816ce1a262 100644 --- a/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.cpp +++ b/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.cpp @@ -15,11 +15,7 @@ #include "app_pipe_handler.h" #include -#include -#include -#include #include "log_print.h" -#include "reporter.h" #ifdef LOG_TAG #undef LOG_TAG diff --git a/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.h b/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.h index 9ea3044858839b4aebfa4e24e4a52048c18db50d..d4c550e0abcc5ab7b929b4077ce7ddeea8750fc4 100644 --- a/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.h +++ b/services/distributeddataservice/adapter/communicator/src/app_pipe_handler.h @@ -21,7 +21,6 @@ #include #include #include "log_print.h" -#include "reporter.h" #include "app_data_change_listener.h" #include "softbus_adapter.h" diff --git a/services/distributeddataservice/adapter/communicator/src/app_pipe_mgr.cpp b/services/distributeddataservice/adapter/communicator/src/app_pipe_mgr.cpp index e96fde31b7bdd56ad56a1acf4f5a3d4137c7fabc..0e66104f84d0fe5f16b6a0e3446649e270e5a2fa 100644 --- a/services/distributeddataservice/adapter/communicator/src/app_pipe_mgr.cpp +++ b/services/distributeddataservice/adapter/communicator/src/app_pipe_mgr.cpp @@ -15,7 +15,6 @@ #include "app_pipe_mgr.h" #include "kvstore_utils.h" -#include "reporter.h" #undef LOG_TAG #define LOG_TAG "AppPipeMgr" diff --git a/services/distributeddataservice/adapter/communicator/src/softbus_adapter_standard.cpp b/services/distributeddataservice/adapter/communicator/src/softbus_adapter_standard.cpp index f4df6deecc68bd90d9e58361b9bff9fd9c29ab2b..5d8e2cb4d114efcb23f3c13aa48d966aa97fbc16 100644 --- a/services/distributeddataservice/adapter/communicator/src/softbus_adapter_standard.cpp +++ b/services/distributeddataservice/adapter/communicator/src/softbus_adapter_standard.cpp @@ -16,14 +16,14 @@ #include #include -#include "communicator_context.h" #include "communication/connect_manager.h" +#include "communicator_context.h" #include "data_level.h" #include "device_manager_adapter.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" +#include "dfx/reporter.h" #include "kvstore_utils.h" #include "log_print.h" -#include "reporter.h" #include "securec.h" #include "session.h" #include "softbus_adapter.h" diff --git a/services/distributeddataservice/adapter/communicator/test/BUILD.gn b/services/distributeddataservice/adapter/communicator/test/BUILD.gn index 5e5a3489d5438eaa917185bec97fa6ec43cf30bd..a85976697641f91ed1b1c162af428da050e69c34 100755 --- a/services/distributeddataservice/adapter/communicator/test/BUILD.gn +++ b/services/distributeddataservice/adapter/communicator/test/BUILD.gn @@ -153,9 +153,6 @@ ohos_unittest("ProcessCommunicatorImplTest") { "../src", "../../include/communicator", "../../include/utils", - "${data_service_path}/adapter/include/communicator", - "${data_service_path}/framework/include/dfx", - "${data_service_path}/framework/include/utils", ] external_deps = [ @@ -180,7 +177,6 @@ ohos_unittest("ProcessCommunicatorImplTest") { "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", - "../../dfx:distributeddata_dfx", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } @@ -190,9 +186,7 @@ ohos_unittest("SoftbusAdapterStandardTest") { sources = [ "../src/app_pipe_handler.cpp", - "../src/app_pipe_handler.h", "../src/app_pipe_mgr.cpp", - "../src/app_pipe_mgr.h", "../src/ark_communication_provider.cpp", "../src/communication_provider.cpp", "../src/communication_provider_impl.cpp", @@ -200,9 +194,7 @@ ohos_unittest("SoftbusAdapterStandardTest") { "../src/data_buffer.cpp", "../src/device_manager_adapter.cpp", "../src/process_communicator_impl.cpp", - "../src/softbus_adapter.h", "../src/softbus_client.cpp", - "../src/softbus_client.h", "unittest/softbus_adapter_standard_test.cpp", ] @@ -235,7 +227,6 @@ ohos_unittest("SoftbusAdapterStandardTest") { deps = [ "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", - "../../dfx:distributeddata_dfx", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } diff --git a/services/distributeddataservice/adapter/dfx/BUILD.gn b/services/distributeddataservice/adapter/dfx/BUILD.gn index dc2a52cb3bc6cd076a8d6c74f61ba01cc4ea6ed7..1b2cc6e710114435a2a0126c4628a91ae23ddab8 100644 --- a/services/distributeddataservice/adapter/dfx/BUILD.gn +++ b/services/distributeddataservice/adapter/dfx/BUILD.gn @@ -43,15 +43,14 @@ ohos_source_set("distributeddata_dfx") { "./src/fault", "./src/statistic", "../include/dfx", - "../include/log", - "../include/utils", - "../include/communicator", - "${data_service_path}/framework/include/dfx", - "${data_service_path}/framework/include/utils", ] cflags_cc = [ "-fvisibility=hidden" ] + deps = [ + "${data_service_path}/framework:distributeddatasvcfwk", + "${data_service_path}/adapter/communicator:distributeddata_communicator", + ] external_deps = [ "c_utils:utils", "device_manager:devicemanagersdk", diff --git a/services/distributeddataservice/adapter/dfx/src/behaviour/behaviour_reporter_impl.h b/services/distributeddataservice/adapter/dfx/src/behaviour/behaviour_reporter_impl.h index 5fff69e41bb6f24f9bbcdb610b3ff164a595600b..b460d27e64bc574d2325e3e7e46f933ef5bdecac 100644 --- a/services/distributeddataservice/adapter/dfx/src/behaviour/behaviour_reporter_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/behaviour/behaviour_reporter_impl.h @@ -16,7 +16,7 @@ #ifndef DISTRIBUTEDDATAMGR_BEHAVIOUR_REPORTER_IMPL_H #define DISTRIBUTEDDATAMGR_BEHAVIOUR_REPORTER_IMPL_H -#include "behaviour_reporter.h" +#include "dfx/behaviour_reporter.h" #include "hiview_adapter.h" namespace OHOS { diff --git a/services/distributeddataservice/adapter/dfx/src/fault/cloud_sync_fault_impl.h b/services/distributeddataservice/adapter/dfx/src/fault/cloud_sync_fault_impl.h index e4e45bc90ab88e468c8f7c07b868afb8bcc2d295..54e6b60b11a3aeaf5490cd6aaefeb34b1176d9f2 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/cloud_sync_fault_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/fault/cloud_sync_fault_impl.h @@ -16,9 +16,9 @@ #ifndef DISTRIBUTEDDATAMGR_DATAMGR_SERVICE_CLOUD_SYNC_FAULT_IMPL_H #define DISTRIBUTEDDATAMGR_DATAMGR_SERVICE_CLOUD_SYNC_FAULT_IMPL_H -#include "fault_reporter.h" +#include "dfx/dfx_types.h" +#include "dfx/fault_reporter.h" #include "hiview_adapter.h" -#include "dfx_types.h" namespace OHOS { namespace DistributedDataDfx { @@ -43,6 +43,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_DATAMGR_SERVICE_CLOUD_SYNC_FAULT_IMPL_H \ No newline at end of file diff --git a/services/distributeddataservice/adapter/dfx/src/fault/communication_fault_impl.h b/services/distributeddataservice/adapter/dfx/src/fault/communication_fault_impl.h index b5ec17f5815be1bed8ee0da324066da6015669dd..19673336e917fbd758beb6801d560e9106c560b5 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/communication_fault_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/fault/communication_fault_impl.h @@ -16,9 +16,9 @@ #ifndef DISTRIBUTEDDATAMGR_COMMUNICATION_FAULT_IMPL_H #define DISTRIBUTEDDATAMGR_COMMUNICATION_FAULT_IMPL_H -#include "fault_reporter.h" +#include "dfx/dfx_types.h" +#include "dfx/fault_reporter.h" #include "hiview_adapter.h" -#include "dfx_types.h" namespace OHOS { namespace DistributedDataDfx { @@ -39,6 +39,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_COMMUNICATION_FAULT_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/src/fault/database_fault_impl.h b/services/distributeddataservice/adapter/dfx/src/fault/database_fault_impl.h index 66c5b39be35301017ce9d7112f6e5b19f836c94f..1185dce0e6bd0c470dad02751f4910bf04a2bfb3 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/database_fault_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/fault/database_fault_impl.h @@ -16,7 +16,7 @@ #ifndef DISTRIBUTEDDATAMGR_DATABASE_FAULT_IMPL_H #define DISTRIBUTEDDATAMGR_DATABASE_FAULT_IMPL_H -#include "fault_reporter.h" +#include "dfx/fault_reporter.h" #include "hiview_adapter.h" namespace OHOS { @@ -38,7 +38,7 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_DATABASE_FAULT_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/src/fault/fault_reporter.cpp b/services/distributeddataservice/adapter/dfx/src/fault/fault_reporter.cpp index 9e714ee7a3e9d89b47b00491fc316f3f7068624e..1a7a35fd0c7b58d21fa812215b264154d23c3f64 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/fault_reporter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/fault/fault_reporter.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "fault_reporter.h" +#include "dfx/fault_reporter.h" namespace OHOS { namespace DistributedDataDfx { diff --git a/services/distributeddataservice/adapter/dfx/src/fault/runtime_fault_impl.h b/services/distributeddataservice/adapter/dfx/src/fault/runtime_fault_impl.h index f4aea1b0e390ec470564b36e1ac902485dcbad75..ae7f1a3e88a53f98f8e75bb202914bf98c626b01 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/runtime_fault_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/fault/runtime_fault_impl.h @@ -15,8 +15,8 @@ #ifndef DISTRIBUTEDDATAMGR_RUNTIME_FAULT_IMPL_H #define DISTRIBUTEDDATAMGR_RUNTIME_FAULT_IMPL_H +#include "dfx/fault_reporter.h" #include "hiview_adapter.h" -#include "fault_reporter.h" namespace OHOS { namespace DistributedDataDfx { @@ -37,6 +37,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_RUNTIME_FAULT_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/src/fault/service_fault_impl.h b/services/distributeddataservice/adapter/dfx/src/fault/service_fault_impl.h index fb5eed6a89eb01d3af3af1d910964fd8549024a4..df665d0c2418d755386b47860c4ab9f7dfac3b7e 100644 --- a/services/distributeddataservice/adapter/dfx/src/fault/service_fault_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/fault/service_fault_impl.h @@ -16,8 +16,8 @@ #ifndef DISTRIBUTEDDATAMGR_SERVICE_FAULT_IMPL_H #define DISTRIBUTEDDATAMGR_SERVICE_FAULT_IMPL_H +#include "dfx/fault_reporter.h" #include "hiview_adapter.h" -#include "fault_reporter.h" namespace OHOS { namespace DistributedDataDfx { @@ -38,6 +38,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_SERVICE_FAULT_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp index 4e1b40f8752218e3fb7575595c3e700f66813afe..c27789c7725dc3ae54bdab9d9d73910bc5a9c029 100644 --- a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp @@ -21,7 +21,7 @@ #include #include "log_print.h" -#include "time_utils.h" +#include "utils/time_utils.h" namespace OHOS { namespace DistributedDataDfx { diff --git a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.h b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.h index a4c5f66546bbb636c72073447fcd2b14b11c56da..f54703866b719fbb16715f3ae604aef91f938325 100644 --- a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.h +++ b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.h @@ -20,7 +20,7 @@ #include #include "dfx_code_constant.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" #include "executor_pool.h" #include "hisysevent_c.h" #include "value_hash.h" diff --git a/services/distributeddataservice/adapter/dfx/src/radar_reporter.cpp b/services/distributeddataservice/adapter/dfx/src/radar_reporter.cpp index cec370a56ae76db2d7fd44ff80d2944ddbcf489d..87aafd4b310657fbca9e7c64901ca00ebd06a3a9 100644 --- a/services/distributeddataservice/adapter/dfx/src/radar_reporter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/radar_reporter.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "radar_reporter.h" +#include "dfx/radar_reporter.h" #include "device_manager_adapter.h" #include "hisysevent.h" diff --git a/services/distributeddataservice/adapter/dfx/src/statistic/api_performance_statistic_impl.h b/services/distributeddataservice/adapter/dfx/src/statistic/api_performance_statistic_impl.h index f253ee7b38c2d116c2b103166ca72aff31bd724a..f5cdff361f66c317378047c593e181a17ab2c368 100644 --- a/services/distributeddataservice/adapter/dfx/src/statistic/api_performance_statistic_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/statistic/api_performance_statistic_impl.h @@ -16,9 +16,9 @@ #ifndef DISTRIBUTEDDATAMGR_API_PERFORMANCE_STATISTIC_IMPL_H #define DISTRIBUTEDDATAMGR_API_PERFORMANCE_STATISTIC_IMPL_H -#include "statistic_reporter.h" +#include "dfx/dfx_types.h" +#include "dfx/statistic_reporter.h" #include "hiview_adapter.h" -#include "dfx_types.h" namespace OHOS { namespace DistributedDataDfx { @@ -31,7 +31,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_API_PERFORMANCE_STATISTIC_IMPL_H - diff --git a/services/distributeddataservice/adapter/dfx/src/statistic/database_statistic_impl.h b/services/distributeddataservice/adapter/dfx/src/statistic/database_statistic_impl.h index c3aa6774d2cf988dd440713ff59a4dc2a38bd0dc..453cd3dd4884501de9e9a929859148953c265c90 100644 --- a/services/distributeddataservice/adapter/dfx/src/statistic/database_statistic_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/statistic/database_statistic_impl.h @@ -16,7 +16,7 @@ #ifndef DISTRIBUTEDDATAMGR_DATABASE_STATISTIC_IMPL_H #define DISTRIBUTEDDATAMGR_DATABASE_STATISTIC_IMPL_H -#include "statistic_reporter.h" +#include "dfx/statistic_reporter.h" #include "hiview_adapter.h" namespace OHOS { diff --git a/services/distributeddataservice/adapter/dfx/src/statistic/statistic_reporter.cpp b/services/distributeddataservice/adapter/dfx/src/statistic/statistic_reporter.cpp index 017ea12ecfdfde6e2dc6d44b8e509f200a44b5d8..e611e44118256dec3f646caffde8385ffa2f0bfd 100644 --- a/services/distributeddataservice/adapter/dfx/src/statistic/statistic_reporter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/statistic/statistic_reporter.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "statistic_reporter.h" +#include "dfx/statistic_reporter.h" namespace OHOS { namespace DistributedDataDfx { diff --git a/services/distributeddataservice/adapter/dfx/src/statistic/traffic_statistic_impl.h b/services/distributeddataservice/adapter/dfx/src/statistic/traffic_statistic_impl.h index c65e888889b5580ce97bc963d171ee12322e43c0..85238d9db32626e7adcea69dcc314e9ffa027e2d 100644 --- a/services/distributeddataservice/adapter/dfx/src/statistic/traffic_statistic_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/statistic/traffic_statistic_impl.h @@ -16,7 +16,7 @@ #ifndef DISTRIBUTEDDATAMGR_TRAFFIC_STATISTIC_IMPL_H #define DISTRIBUTEDDATAMGR_TRAFFIC_STATISTIC_IMPL_H -#include "statistic_reporter.h" +#include "dfx/statistic_reporter.h" #include "hiview_adapter.h" namespace OHOS { @@ -30,6 +30,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_TRAFFIC_STATISTIC_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/src/statistic/visit_statistic_impl.h b/services/distributeddataservice/adapter/dfx/src/statistic/visit_statistic_impl.h index fb5b933ec46d3e669bfdf5adb586741b4feb8582..9898ad546e5621f05f56d5ed7b3adfd8d39073fa 100644 --- a/services/distributeddataservice/adapter/dfx/src/statistic/visit_statistic_impl.h +++ b/services/distributeddataservice/adapter/dfx/src/statistic/visit_statistic_impl.h @@ -16,7 +16,7 @@ #ifndef DISTRIBUTEDDATAMGR_VISIT_STATISTIC_IMPL_H #define DISTRIBUTEDDATAMGR_VISIT_STATISTIC_IMPL_H -#include "statistic_reporter.h" +#include "dfx/statistic_reporter.h" #include "hiview_adapter.h" namespace OHOS { @@ -30,6 +30,6 @@ public: private: std::shared_ptr executors_; }; -} // namespace DistributedDataDfx -} // namespace OHOS +} // namespace DistributedDataDfx +} // namespace OHOS #endif // DISTRIBUTEDDATAMGR_VISIT_STATISTIC_IMPL_H diff --git a/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_mst_test.cpp b/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_mst_test.cpp index c5a67afe6e9cc8201f02d047f6114852b0610c64..5c0065d8e93b26c83bad82eb46db0889b83a7817 100644 --- a/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_mst_test.cpp +++ b/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_mst_test.cpp @@ -15,7 +15,7 @@ #include #include -#include "reporter.h" +#include "dfx/reporter.h" using namespace testing::ext; using namespace OHOS::DistributedDataDfx; diff --git a/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_ut_test.cpp b/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_ut_test.cpp index d7fed644ccdfb6ca8cc764d811e02c8a663eda21..4530a0032a4e5e50af27ef2c8ca2e50bd253d91b 100644 --- a/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_ut_test.cpp +++ b/services/distributeddataservice/adapter/dfx/test/unittest/distributeddata_dfx_ut_test.cpp @@ -15,7 +15,7 @@ #include #include -#include "reporter.h" +#include "dfx/reporter.h" #include "fake_hiview.h" #include "value_hash.h" diff --git a/services/distributeddataservice/adapter/dfx/test/unittest/hiview_adapter_dfx_test.cpp b/services/distributeddataservice/adapter/dfx/test/unittest/hiview_adapter_dfx_test.cpp index 1d2ebaf869828cb254b7e80eaf53cdb5058a3fea..7ac97e3928a8e02fd73571842ad4b098522049ca 100644 --- a/services/distributeddataservice/adapter/dfx/test/unittest/hiview_adapter_dfx_test.cpp +++ b/services/distributeddataservice/adapter/dfx/test/unittest/hiview_adapter_dfx_test.cpp @@ -15,11 +15,11 @@ #define LOG_TAG "HiViewAdapterDfxTest" #include "device_manager_adapter.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" +#include "dfx/radar_reporter.h" #include "gtest/gtest.h" #include "hiview_adapter.h" #include "log_print.h" -#include "radar_reporter.h" using namespace OHOS; using namespace testing; diff --git a/services/distributeddataservice/adapter/include/dfx/reporter_impl.h b/services/distributeddataservice/adapter/include/dfx/reporter_impl.h index f8cc3c453c7f2bbf0c9c913c73da53ba44026888..c5e9f1f22347831776f108439ff58e73ef14f99b 100644 --- a/services/distributeddataservice/adapter/include/dfx/reporter_impl.h +++ b/services/distributeddataservice/adapter/include/dfx/reporter_impl.h @@ -19,12 +19,12 @@ #include #include -#include "behaviour_reporter.h" -#include "dfx_types.h" +#include "dfx/behaviour_reporter.h" +#include "dfx/dfx_types.h" #include "executor_pool.h" -#include "fault_reporter.h" -#include "reporter.h" -#include "statistic_reporter.h" +#include "dfx/fault_reporter.h" +#include "dfx/reporter.h" +#include "dfx/statistic_reporter.h" namespace OHOS { namespace DistributedDataDfx { diff --git a/services/distributeddataservice/adapter/network/BUILD.gn b/services/distributeddataservice/adapter/network/BUILD.gn index fb25666a3e8d6dffb138528bd670ca802d376822..880033e06a8702466784a4aee142e67cfc115c4a 100644 --- a/services/distributeddataservice/adapter/network/BUILD.gn +++ b/services/distributeddataservice/adapter/network/BUILD.gn @@ -13,15 +13,9 @@ import("//build/ohos.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") -config("network_public_config") { +config("module_public_config") { visibility = [ ":*" ] - include_dirs = [ - "${data_service_path}/adapter/network/src", - "${data_service_path}/framework/include/network", - ] - if (datamgr_service_cloud) { - include_dirs += [ "${data_service_path}/adapter/include/communicator" ] - } + include_dirs = [ "${data_service_path}/adapter" ] } ohos_source_set("distributeddata_network") { @@ -39,7 +33,7 @@ ohos_source_set("distributeddata_network") { "-Oz", ] - configs = [ ":network_public_config" ] + configs = [ ":module_public_config" ] cflags = [ "-fdata-sections", "-ffunction-sections", @@ -50,13 +44,12 @@ ohos_source_set("distributeddata_network") { "-Oz", ] + deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] external_deps = [ "kv_store:datamgr_common" ] if (datamgr_service_cloud) { sources += [ "src/network_delegate_normal_impl.cpp" ] - deps = [ - "${data_service_path}/adapter/communicator:distributeddata_communicator", - ] + deps += [ "${data_service_path}/adapter/communicator:distributeddata_communicator" ] external_deps += [ "device_manager:devicemanagersdk", "hilog:libhilog", diff --git a/services/distributeddataservice/adapter/network/src/network_delegate_default_impl.h b/services/distributeddataservice/adapter/network/src/network_delegate_default_impl.h index b3ddd1a17d745adba678be83928e4d038a2a49ff..16f3e258180f5b4b9cf2538438365ef8734e048a 100644 --- a/services/distributeddataservice/adapter/network/src/network_delegate_default_impl.h +++ b/services/distributeddataservice/adapter/network/src/network_delegate_default_impl.h @@ -16,7 +16,7 @@ #ifndef OHOS_DISTRIBUTED_DATA_NETWORK_DELEGATE_DEFAULT_IMPL_H #define OHOS_DISTRIBUTED_DATA_NETWORK_DELEGATE_DEFAULT_IMPL_H -#include "network_delegate.h" +#include "network/network_delegate.h" namespace OHOS::DistributedData { class NetworkDelegateDefaultImpl : public NetworkDelegate { diff --git a/services/distributeddataservice/adapter/network/src/network_delegate_normal_impl.h b/services/distributeddataservice/adapter/network/src/network_delegate_normal_impl.h index f4c62051d58b81a257489e62355093e6907bba24..e5944270dc0ebbaf77786ba14d8e3bc995ab8fa3 100644 --- a/services/distributeddataservice/adapter/network/src/network_delegate_normal_impl.h +++ b/services/distributeddataservice/adapter/network/src/network_delegate_normal_impl.h @@ -20,7 +20,7 @@ #include #include "dm_device_info.h" -#include "network_delegate.h" +#include "network/network_delegate.h" namespace OHOS::DistributedData { class NetworkDelegateNormalImpl : public NetworkDelegate { diff --git a/services/distributeddataservice/adapter/schema_helper/BUILD.gn b/services/distributeddataservice/adapter/schema_helper/BUILD.gn index 26095037dd806772c7558398eed28582115fdd58..c3516c441a77a4c80451f2493c5568a9e1419b4a 100644 --- a/services/distributeddataservice/adapter/schema_helper/BUILD.gn +++ b/services/distributeddataservice/adapter/schema_helper/BUILD.gn @@ -15,7 +15,7 @@ import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") config("module_public_config") { visibility = [ ":*" ] - include_dirs = [ "../include/schema_helper" ] + include_dirs = [ "." ] } ohos_source_set("distributeddata_schema_helper") { @@ -27,11 +27,12 @@ ohos_source_set("distributeddata_schema_helper") { boundary_sanitize = true ubsan = true } - sources = [ "src/get_schema_helper.cpp" ] + sources = [ "get_schema_helper.cpp" ] - cflags_cc = [ "-fvisibility=hidden" ] - - include_dirs = [ "../include/schema_helper" ] + cflags_cc = [ + "-fvisibility=hidden", + "-fstack-protector-strong", + ] public_configs = [ ":module_public_config" ] external_deps = [ diff --git a/services/distributeddataservice/adapter/schema_helper/src/get_schema_helper.cpp b/services/distributeddataservice/adapter/schema_helper/get_schema_helper.cpp similarity index 100% rename from services/distributeddataservice/adapter/schema_helper/src/get_schema_helper.cpp rename to services/distributeddataservice/adapter/schema_helper/get_schema_helper.cpp diff --git a/services/distributeddataservice/adapter/include/schema_helper/get_schema_helper.h b/services/distributeddataservice/adapter/schema_helper/get_schema_helper.h similarity index 99% rename from services/distributeddataservice/adapter/include/schema_helper/get_schema_helper.h rename to services/distributeddataservice/adapter/schema_helper/get_schema_helper.h index 9a0462f788c15015eed86968101af026d7288390..ab937d351dc5b2105d3be3704abc3c5271ef461b 100644 --- a/services/distributeddataservice/adapter/include/schema_helper/get_schema_helper.h +++ b/services/distributeddataservice/adapter/schema_helper/get_schema_helper.h @@ -17,6 +17,7 @@ #include #include +#include #include "iremote_object.h" diff --git a/services/distributeddataservice/adapter/screenlock/BUILD.gn b/services/distributeddataservice/adapter/screenlock/BUILD.gn index ed1fd3913264cbc69ab99c4a525b120fc0793093..f7813d16ae5216cff3758cfd88d67cbc7ea06eda 100644 --- a/services/distributeddataservice/adapter/screenlock/BUILD.gn +++ b/services/distributeddataservice/adapter/screenlock/BUILD.gn @@ -13,6 +13,11 @@ import("//build/ohos.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") +config("module_public_config") { + visibility = [ ":*" ] + include_dirs = [ "${data_service_path}/adapter" ] +} + ohos_source_set("distributeddata_screenlock") { branch_protector_ret = "pac_ret" sanitize = { @@ -22,17 +27,18 @@ ohos_source_set("distributeddata_screenlock") { boundary_sanitize = true ubsan = true } - sources = [ "src/screen_lock.cpp" ] + sources = [ "screen_lock.cpp" ] - cflags_cc = [ "-fvisibility=hidden" ] - - include_dirs = [ - "../include/screenlock", - "../include/utils", - "${data_service_path}/framework/include", + cflags_cc = [ + "-fvisibility=hidden", + "-fstack-protector-strong", ] - deps = [ "${data_service_path}/adapter/account:distributeddata_account" ] + public_configs = [ ":module_public_config" ] + deps = [ + "${data_service_path}/adapter/account:distributeddata_account", + "${data_service_path}/framework:distributeddatasvcfwk", + ] external_deps = [ "c_utils:utils", diff --git a/services/distributeddataservice/adapter/screenlock/src/screen_lock.cpp b/services/distributeddataservice/adapter/screenlock/screen_lock.cpp similarity index 100% rename from services/distributeddataservice/adapter/screenlock/src/screen_lock.cpp rename to services/distributeddataservice/adapter/screenlock/screen_lock.cpp diff --git a/services/distributeddataservice/adapter/include/screenlock/screen_lock.h b/services/distributeddataservice/adapter/screenlock/screen_lock.h similarity index 100% rename from services/distributeddataservice/adapter/include/screenlock/screen_lock.h rename to services/distributeddataservice/adapter/screenlock/screen_lock.h diff --git a/services/distributeddataservice/adapter/screenlock/test/BUILD.gn b/services/distributeddataservice/adapter/screenlock/test/BUILD.gn index f1f16b53b97aa91b48e36de832466a7d197a9a9c..b7d623574eb4c2a6e1883446df149bb7a35fe538 100755 --- a/services/distributeddataservice/adapter/screenlock/test/BUILD.gn +++ b/services/distributeddataservice/adapter/screenlock/test/BUILD.gn @@ -18,30 +18,23 @@ module_output_path = "datamgr_service/datamgr_service/distributeddatafwk" ohos_unittest("ScreenLockTest") { module_out_path = module_output_path - sources = [ - "${data_service_path}/adapter/screenlock/src/screen_lock.cpp", - "${data_service_path}/framework/account/account_delegate.cpp", - "${data_service_path}/framework/screen/screen_manager.cpp", - "screen_lock_test.cpp", - ] - include_dirs = [ - "${data_service_path}/adapter/include/screenlock", - "${data_service_path}/framework/include", - "${data_service_path}/framework/include/account", - ] + sources = [ "screen_lock_test.cpp" ] + cflags = [ "-Dprivate=public", "-Dprotected=public", "-Werror", ] + deps = [ + "${data_service_path}/adapter/screenlock:distributeddata_screenlock", + "${data_service_path}/framework:distributeddatasvcfwk" + ] external_deps = [ - "c_utils:utils", "common_event_service:cesfwk_innerkits", "googletest:gtest_main", "hilog:libhilog", - "kv_store:distributeddata_inner", - "screenlock_mgr:screenlock_client", + "kv_store:datamgr_common", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } diff --git a/services/distributeddataservice/adapter/screenlock/test/screen_lock_test.cpp b/services/distributeddataservice/adapter/screenlock/test/screen_lock_test.cpp index be5a5f5f1b1c174aa2bbd0ed270e72bb83a316a8..263c17dde0bcaaac5c4826fad9e989786205d38d 100644 --- a/services/distributeddataservice/adapter/screenlock/test/screen_lock_test.cpp +++ b/services/distributeddataservice/adapter/screenlock/test/screen_lock_test.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "screen_lock.h" +#include "screenlock/screen_lock.h" #include namespace { @@ -65,7 +65,6 @@ public: HWTEST_F(ScreenLockTest, Subscribe001, TestSize.Level0) { auto screenLock = std::make_shared(); - screenLock->ScreenManager::Subscribe(nullptr); screenLock->Subscribe(nullptr); EXPECT_TRUE(screenLock->observerMap_.Empty()); auto observer = std::make_shared(); @@ -101,7 +100,6 @@ HWTEST_F(ScreenLockTest, Subscribe002, TestSize.Level0) HWTEST_F(ScreenLockTest, Unsubscribe001, TestSize.Level0) { auto screenLock = std::make_shared(); - screenLock->ScreenManager::Unsubscribe(nullptr); auto observer = std::make_shared(); screenLock->Subscribe(observer); EXPECT_EQ(screenLock->observerMap_.Size(), 1); @@ -122,10 +120,8 @@ HWTEST_F(ScreenLockTest, SubscribeScreenEvent001, TestSize.Level0) screenLock->BindExecutor(executor); ASSERT_NE(screenLock->executors_, nullptr); EXPECT_EQ(screenLock->eventSubscriber_, nullptr); - screenLock->ScreenManager::SubscribeScreenEvent(); screenLock->SubscribeScreenEvent(); EXPECT_NE(screenLock->eventSubscriber_, nullptr); - screenLock->ScreenManager::UnsubscribeScreenEvent(); screenLock->UnsubscribeScreenEvent(); } } // namespace \ No newline at end of file diff --git a/services/distributeddataservice/adapter/test/BUILD.gn b/services/distributeddataservice/adapter/test/BUILD.gn index 6f6f3b435e02812d2ab6e46a46646c7a8683218b..db76543ebbd899d5b75d161a247082010672fa19 100755 --- a/services/distributeddataservice/adapter/test/BUILD.gn +++ b/services/distributeddataservice/adapter/test/BUILD.gn @@ -22,9 +22,12 @@ group("unittest") { "../account/test:unittest", "../communicator/test:unittest", "../dfx/test:unittest", - "../screenlock/test:unittest", ] + if (defined(global_parts_info) && defined(global_parts_info.theme_screenlock_mgr)) { + deps += [ "${data_service_path}/adapter/screenlock/test:unittest" ] + } + if (datamgr_service_cloud) { deps += [ "../network/test:unittest" ] } diff --git a/services/distributeddataservice/app/src/kvstore_account_observer.h b/services/distributeddataservice/app/src/kvstore_account_observer.h index d8ea3d153caafdf98e16a4c8f5e61faf36c650b9..bbc535088ddb3ceec9fe23e49749debefb58ff2f 100644 --- a/services/distributeddataservice/app/src/kvstore_account_observer.h +++ b/services/distributeddataservice/app/src/kvstore_account_observer.h @@ -18,7 +18,7 @@ #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "executor_pool.h" namespace OHOS { diff --git a/services/distributeddataservice/app/src/kvstore_data_service.cpp b/services/distributeddataservice/app/src/kvstore_data_service.cpp index 03cae1122ddd7012c4200e037e77725b93842f09..673af00a581e8c7af5f46ef04ef0a5cb54d7bf40 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.cpp +++ b/services/distributeddataservice/app/src/kvstore_data_service.cpp @@ -37,6 +37,7 @@ #include "db_info_handle_impl.h" #include "device_manager_adapter.h" #include "device_matrix.h" +#include "dfx/reporter.h" #include "dump/dump_manager.h" #include "dump_helper.h" #include "eventcenter/event_center.h" @@ -54,7 +55,6 @@ #include "permission_validator.h" #include "permit_delegate.h" #include "process_communicator_impl.h" -#include "reporter.h" #include "route_head_handler_impl.h" #include "runtime_config.h" #include "store/auto_cache.h" diff --git a/services/distributeddataservice/app/src/kvstore_data_service.h b/services/distributeddataservice/app/src/kvstore_data_service.h index 8dea8bb490b99b2bb1b42d708ff84dadb8197013..d548368676ac09b6595ffff8b68cb4535201ad5a 100644 --- a/services/distributeddataservice/app/src/kvstore_data_service.h +++ b/services/distributeddataservice/app/src/kvstore_data_service.h @@ -21,23 +21,23 @@ #include #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "clone/clone_backup_info.h" #include "clone/secret_key_backup_data.h" +#include "dfx/reporter.h" +#include "executor_pool.h" #include "feature_stub_impl.h" #include "ikvstore_data_service.h" #include "ithread_pool.h" +#include "kvstore_data_service_stub.h" #include "kvstore_device_listener.h" #include "kvstore_meta_manager.h" -#include "kvstore_data_service_stub.h" #include "metadata/secret_key_meta_data.h" #include "metadata/store_meta_data.h" -#include "reporter.h" #include "runtime_config.h" #include "screen/screen_manager.h" #include "security/security.h" #include "system_ability.h" -#include "executor_pool.h" #include "types.h" #include "unique_fd.h" diff --git a/services/distributeddataservice/app/src/kvstore_meta_manager.cpp b/services/distributeddataservice/app/src/kvstore_meta_manager.cpp index 304048400b9b514950dff97ca1dd3a33f37ff93e..9c8013f8b7cf3fb41283ff9553fdd1619269b1ff 100644 --- a/services/distributeddataservice/app/src/kvstore_meta_manager.cpp +++ b/services/distributeddataservice/app/src/kvstore_meta_manager.cpp @@ -20,9 +20,8 @@ #include #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "bootstrap.h" -#include "cloud/change_event.h" #include "communication_provider.h" #include "crypto_manager.h" #include "device_manager_adapter.h" diff --git a/services/distributeddataservice/app/src/session_manager/upgrade_manager.cpp b/services/distributeddataservice/app/src/session_manager/upgrade_manager.cpp index 4055f30f131ba62cb609b7d17a3bae9ae415bc51..2276159fa202293bbe764d9f337e7141e6b61a6f 100644 --- a/services/distributeddataservice/app/src/session_manager/upgrade_manager.cpp +++ b/services/distributeddataservice/app/src/session_manager/upgrade_manager.cpp @@ -17,13 +17,11 @@ #include "upgrade_manager.h" #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "device_manager_adapter.h" #include "log_print.h" #include "metadata/meta_data_manager.h" #include "utils/anonymous.h" -#include "utils/constant.h" -#include "app_id_mapping/app_id_mapping_config_manager.h" namespace OHOS::DistributedData { using namespace OHOS::DistributedKv; diff --git a/services/distributeddataservice/framework/BUILD.gn b/services/distributeddataservice/framework/BUILD.gn index a99bba56a8357c480ade0ff429361df15181ce3b..53b402127441eb41b1d812b7e95b8a5586ad9466 100644 --- a/services/distributeddataservice/framework/BUILD.gn +++ b/services/distributeddataservice/framework/BUILD.gn @@ -34,9 +34,6 @@ config("module_public_config") { visibility = [ ":*" ] include_dirs = [ "include", - "${data_service_path}/framework/include/account", - "${data_service_path}/framework/include/dfx", - "${data_service_path}/framework/include/network", "${kv_store_common_path}", ] } diff --git a/services/distributeddataservice/framework/account/account_delegate.cpp b/services/distributeddataservice/framework/account/account_delegate.cpp index 2b77557d43bc96b5fbac2ab39e6c99824e6a8ada..6ef959548c5f4ffbd07d3f22fa34a72ac9e7c0f4 100644 --- a/services/distributeddataservice/framework/account/account_delegate.cpp +++ b/services/distributeddataservice/framework/account/account_delegate.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "account_delegate.h" +#include "account/account_delegate.h" namespace OHOS { namespace DistributedData { diff --git a/services/distributeddataservice/framework/dfx/reporter.cpp b/services/distributeddataservice/framework/dfx/reporter.cpp index 4b003109b9654b35b3afd5914ca41d9df901a50a..14ba18c836fec656391fb10bf5f9a98f9c8fadb5 100644 --- a/services/distributeddataservice/framework/dfx/reporter.cpp +++ b/services/distributeddataservice/framework/dfx/reporter.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "reporter.h" +#include "dfx/reporter.h" namespace OHOS { namespace DistributedDataDfx { diff --git a/services/distributeddataservice/framework/network/network_delegate.cpp b/services/distributeddataservice/framework/network/network_delegate.cpp index 368fb1598f94d68ce5f925566af4a31d74d345b5..37326525a44c222e9c5877e3a5f8964ae6234d21 100644 --- a/services/distributeddataservice/framework/network/network_delegate.cpp +++ b/services/distributeddataservice/framework/network/network_delegate.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "network_delegate.h" +#include "network/network_delegate.h" namespace OHOS { namespace DistributedData { diff --git a/services/distributeddataservice/framework/store/auto_cache.cpp b/services/distributeddataservice/framework/store/auto_cache.cpp index 0b17f5bc3e0e909a66038eb0237714dc63b178a7..b6343164e4fad1818132c64d687b0806dd825b47 100644 --- a/services/distributeddataservice/framework/store/auto_cache.cpp +++ b/services/distributeddataservice/framework/store/auto_cache.cpp @@ -17,11 +17,11 @@ #include -#include "account_delegate.h" +#include "account/account_delegate.h" #include "changeevent/remote_change_event.h" #include "eventcenter/event_center.h" #include "log_print.h" -#include "screenlock/screen_lock.h" +#include "screen/screen_manager.h" #include "utils/anonymous.h" namespace OHOS::DistributedData { using Account = AccountDelegate; diff --git a/services/distributeddataservice/service/BUILD.gn b/services/distributeddataservice/service/BUILD.gn index 952c928951eab0a90fbd2aa9f499dcb3f2319ed5..b2c3d041521e6c69c9df2c828e860b809644cffa 100644 --- a/services/distributeddataservice/service/BUILD.gn +++ b/services/distributeddataservice/service/BUILD.gn @@ -78,6 +78,7 @@ ohos_shared_library("distributeddatasvc") { deps = [ "${data_service_path}/adapter/account:distributeddata_account", "${data_service_path}/adapter/communicator:distributeddata_communicator", + "${data_service_path}/adapter/dfx:distributeddata_dfx", "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service/backup:distributeddata_backup", diff --git a/services/distributeddataservice/service/cloud/cloud_service_impl.cpp b/services/distributeddataservice/service/cloud/cloud_service_impl.cpp index fe9aa097bb835088cb0917cf0a5549a2e33e97b9..f566532a7a43f64a9e30fe5dc6a2640b213e23e2 100644 --- a/services/distributeddataservice/service/cloud/cloud_service_impl.cpp +++ b/services/distributeddataservice/service/cloud/cloud_service_impl.cpp @@ -32,18 +32,18 @@ #include "cloud_data_translate.h" #include "cloud_value_util.h" #include "device_manager_adapter.h" -#include "radar_reporter.h" +#include "dfx/radar_reporter.h" +#include "dfx/reporter.h" #include "eventcenter/event_center.h" +#include "get_schema_helper.h" #include "hap_token_info.h" #include "ipc_skeleton.h" #include "log_print.h" #include "metadata/meta_data_manager.h" #include "network/network_delegate.h" #include "rdb_types.h" -#include "reporter.h" #include "relational_store_manager.h" #include "runtime_config.h" -#include "get_schema_helper.h" #include "store/auto_cache.h" #include "sync_manager.h" #include "sync_strategies/network_sync_strategy.h" @@ -51,7 +51,6 @@ #include "values_bucket.h" #include "xcollie.h" - namespace OHOS::CloudData { using namespace DistributedData; using namespace std::chrono; diff --git a/services/distributeddataservice/service/cloud/cloud_service_impl.h b/services/distributeddataservice/service/cloud/cloud_service_impl.h index 21283817f210f1f06cb0611f7a7fc4bff8aec9b3..d0242197b58ce03ba8dd05b9fb80a30f6b25c254 100644 --- a/services/distributeddataservice/service/cloud/cloud_service_impl.h +++ b/services/distributeddataservice/service/cloud/cloud_service_impl.h @@ -26,7 +26,7 @@ #include "cloud/sharing_center.h" #include "cloud/subscription.h" #include "cloud_service_stub.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" #include "feature/static_acts.h" #include "store/general_store.h" #include "sync_manager.h" diff --git a/services/distributeddataservice/service/cloud/sync_manager.cpp b/services/distributeddataservice/service/cloud/sync_manager.cpp index adb7e9e532a792693a0dfd4efac47f05334b6719..f949d37c7afbf3e85c0babc48bda8d532dbc4dd1 100644 --- a/services/distributeddataservice/service/cloud/sync_manager.cpp +++ b/services/distributeddataservice/service/cloud/sync_manager.cpp @@ -26,12 +26,12 @@ #include "cloud/schema_meta.h" #include "cloud_value_util.h" #include "device_manager_adapter.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" +#include "dfx/reporter.h" #include "eventcenter/event_center.h" #include "log_print.h" #include "metadata/meta_data_manager.h" #include "network/network_delegate.h" -#include "reporter.h" #include "screen/screen_manager.h" #include "sync_strategies/network_sync_strategy.h" #include "user_delegate.h" diff --git a/services/distributeddataservice/service/cloud/sync_manager.h b/services/distributeddataservice/service/cloud/sync_manager.h index bc19b107b1c29f4ae79c2ba187c1ce91b70eeb30..0769c4ea4870cc2048f3c74692b973d843400b98 100644 --- a/services/distributeddataservice/service/cloud/sync_manager.h +++ b/services/distributeddataservice/service/cloud/sync_manager.h @@ -23,6 +23,7 @@ #include "cloud_types.h" #include "cloud/sync_event.h" #include "concurrent_map.h" +#include "dfx/radar_reporter.h" #include "eventcenter/event.h" #include "executor_pool.h" #include "metadata/store_meta_data_local.h" @@ -30,7 +31,6 @@ #include "store/general_store.h" #include "store/general_value.h" #include "utils/ref_count.h" -#include "radar_reporter.h" namespace OHOS::CloudData { class SyncManager { diff --git a/services/distributeddataservice/service/data_share/common/db_delegate.cpp b/services/distributeddataservice/service/data_share/common/db_delegate.cpp index 50196297bc07fdfe60a94bcbc58ff6d62a6fbc46..765d69b5cef356952e244a4b542018c6da61b5fc 100644 --- a/services/distributeddataservice/service/data_share/common/db_delegate.cpp +++ b/services/distributeddataservice/service/data_share/common/db_delegate.cpp @@ -16,7 +16,7 @@ #define LOG_TAG "DBAdaptor" #include "db_delegate.h" -#include "account_delegate.h" +#include "account/account_delegate.h" #include "kv_delegate.h" #include "log_print.h" #include "rdb_delegate.h" diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.h b/services/distributeddataservice/service/data_share/data_share_service_impl.h index 90ee77d4a8b5aa4654ae278ce142d95101e3e3d7..3baf322515f38923e636b57d1df2b66001781aaf 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.h +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.h @@ -22,11 +22,11 @@ #include "accesstoken_kit.h" #include "bundle_mgr_proxy.h" +#include "changeevent/remote_change_event.h" #include "common_event_subscribe_info.h" #include "common_event_subscriber.h" -#include "changeevent/remote_change_event.h" -#include "data_proxy_observer.h" #include "data_provider_config.h" +#include "data_proxy_observer.h" #include "data_share_db_config.h" #include "data_share_service_stub.h" #include "data_share_silent_config.h" diff --git a/services/distributeddataservice/service/kvdb/kvdb_exporter.cpp b/services/distributeddataservice/service/kvdb/kvdb_exporter.cpp index 3b41e3442b2d6d258c9fa07b0768b1e17113cafc..11016183d00d8aa604668f4abddfc216982d1dd8 100644 --- a/services/distributeddataservice/service/kvdb/kvdb_exporter.cpp +++ b/services/distributeddataservice/service/kvdb/kvdb_exporter.cpp @@ -16,10 +16,10 @@ #include "kvdb_exporter.h" #include "backup_manager.h" +#include "dfx/reporter.h" #include "directory/directory_manager.h" #include "kvdb_general_store.h" #include "log_print.h" -#include "reporter.h" namespace OHOS::DistributedKv { using namespace OHOS::DistributedData; using namespace OHOS::DistributedDataDfx; diff --git a/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp b/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp index 05a49cda23ebb8c09c8e1007fbf5d82c78d3e795..b2fab36ce1372baebde812d824559fdba10e5cac 100644 --- a/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp +++ b/services/distributeddataservice/service/kvdb/kvdb_general_store.cpp @@ -25,7 +25,8 @@ #include "crypto_manager.h" #include "device_manager_adapter.h" #include "device_matrix.h" -#include "dfx_types.h" +#include "dfx/dfx_types.h" +#include "dfx/reporter.h" #include "directory/directory_manager.h" #include "eventcenter/event_center.h" #include "kvdb_query.h" @@ -35,7 +36,6 @@ #include "metadata/store_meta_data_local.h" #include "query_helper.h" #include "rdb_cloud.h" -#include "reporter.h" #include "snapshot/bind_event.h" #include "types.h" #include "user_delegate.h" diff --git a/services/distributeddataservice/service/rdb/rdb_general_store.cpp b/services/distributeddataservice/service/rdb/rdb_general_store.cpp index 4c4354c477ab3157aa0c124152dd094a18a564df..ba0299bddaf21e6f970eafa881b5f75cc9b772aa 100644 --- a/services/distributeddataservice/service/rdb/rdb_general_store.cpp +++ b/services/distributeddataservice/service/rdb/rdb_general_store.cpp @@ -29,20 +29,17 @@ #include "device_sync_app/device_sync_app_manager.h" #include "cloud_service.h" #include "commonevent/data_sync_event.h" -#include "communicator/device_manager_adapter.h" #include "crypto_manager.h" -#include "dfx_types.h" #include "device_manager_adapter.h" +#include "dfx/dfx_types.h" +#include "dfx/reporter.h" #include "eventcenter/event_center.h" #include "log_print.h" #include "metadata/meta_data_manager.h" #include "metadata/secret_key_meta_data.h" #include "rdb_cursor.h" -#include "rdb_helper.h" #include "rdb_query.h" -#include "rdb_result_set_impl.h" #include "relational_store_manager.h" -#include "reporter.h" #include "snapshot/bind_event.h" #include "utils/anonymous.h" #include "value_proxy.h" diff --git a/services/distributeddataservice/service/rdb/rdb_service_impl.cpp b/services/distributeddataservice/service/rdb/rdb_service_impl.cpp index b2d0164d168668d599b5d2736c2653e4ba8de585..7a27b909abe5a137b5c4faffd922351c76c4ca4b 100644 --- a/services/distributeddataservice/service/rdb/rdb_service_impl.cpp +++ b/services/distributeddataservice/service/rdb/rdb_service_impl.cpp @@ -232,12 +232,23 @@ bool RdbServiceImpl::CheckAccess(const std::string& bundleName, const std::strin return CheckerManager::GetInstance().IsValid(storeInfo); } -std::string RdbServiceImpl::ObtainDistributedTableName(const std::string &device, const std::string &table) +std::string RdbServiceImpl::ObtainDistributedTableName(const RdbSyncerParam ¶m, const std::string &device, + const std::string &table) { - ZLOGI("device=%{public}s table=%{public}s", Anonymous::Change(device).c_str(), table.c_str()); - auto uuid = DmAdapter::GetInstance().GetUuidByNetworkId(device); + if (!CheckAccess(param.bundleName_, "")) { + ZLOGE("bundleName:%{public}s. Permission error", param.bundleName_.c_str()); + return ""; + } + auto tokenId = IPCSkeleton::GetCallingTokenID(); + std::string appId = " "; + if (AccessTokenKit::GetTokenTypeFlag(tokenId) == Security::AccessToken::TOKEN_HAP) { + auto uid = IPCSkeleton::GetCallingUid(); + appId = CheckerManager::GetInstance().GetAppId({ uid, tokenId, param.bundleName_ }); + } + auto uuid = DmAdapter::GetInstance().CalcClientUuid(appId, DmAdapter::GetInstance().ToUUID(device)); if (uuid.empty()) { - ZLOGE("get uuid failed"); + ZLOGE("get uuid failed, bundle:%{public}s, deviceId:%{public}s, table:%{public}s", param.bundleName_.c_str(), + Anonymous::Change(device).c_str(), Anonymous::Change(table).c_str()); return ""; } return DistributedDB::RelationalStoreManager::GetDistributedTableName(uuid, table); @@ -598,7 +609,7 @@ void RdbServiceImpl::DoCloudSync(const RdbSyncerParam ¶m, const RdbService:: ? GeneralStore::ASSETS_SYNC_MODE : (option.isAutoSync ? GeneralStore::AUTO_SYNC_MODE : GeneralStore::MANUAL_SYNC_MODE); auto mixMode = static_cast(GeneralStore::MixMode(option.mode, highMode)); - SyncParam syncParam = { mixMode, (option.isAsync ? 0 : WAIT_TIME), option.isCompensation }; + SyncParam syncParam = { mixMode, (option.isAsync ? 0 : static_cast(WAIT_TIME)), option.isCompensation }; syncParam.asyncDownloadAsset = param.asyncDownloadAsset_; auto info = ChangeEvent::EventInfo(syncParam, option.isAutoSync, query, option.isAutoSync ? nullptr diff --git a/services/distributeddataservice/service/rdb/rdb_service_impl.h b/services/distributeddataservice/service/rdb/rdb_service_impl.h index e58c6618f209888d123b6d7f72dd164984f99a8b..901833eefcd24d974da75b8ce548524ce544025a 100755 --- a/services/distributeddataservice/service/rdb/rdb_service_impl.h +++ b/services/distributeddataservice/service/rdb/rdb_service_impl.h @@ -53,7 +53,8 @@ public: virtual ~RdbServiceImpl(); /* IPC interface */ - std::string ObtainDistributedTableName(const std::string& device, const std::string& table) override; + std::string ObtainDistributedTableName(const RdbSyncerParam ¶m, const std::string &device, + const std::string &table) override; int32_t InitNotifier(const RdbSyncerParam ¶m, sptr notifier) override; diff --git a/services/distributeddataservice/service/rdb/rdb_service_stub.cpp b/services/distributeddataservice/service/rdb/rdb_service_stub.cpp index 737b216bbe98d95f4e4363bb8181c2174c909dbe..f52549c1f7aee6a8e0bcd8f23b604a9ec7585fca 100755 --- a/services/distributeddataservice/service/rdb/rdb_service_stub.cpp +++ b/services/distributeddataservice/service/rdb/rdb_service_stub.cpp @@ -28,15 +28,17 @@ namespace OHOS::DistributedRdb { using Anonymous = DistributedData::Anonymous; int32_t RdbServiceStub::OnRemoteObtainDistributedTableName(MessageParcel &data, MessageParcel &reply) { + RdbSyncerParam param; std::string device; std::string table; - if (!ITypesUtil::Unmarshal(data, device, table)) { + if (!ITypesUtil::Unmarshal(data, param, device, table)) { ZLOGE("Unmarshal device:%{public}s table:%{public}s", Anonymous::Change(device).c_str(), table.c_str()); return IPC_STUB_INVALID_DATA_ERR; } - std::string distributedTableName = ObtainDistributedTableName(device, table); - if (!ITypesUtil::Marshal(reply, distributedTableName)) { + std::string distributedTableName = ObtainDistributedTableName(param, device, table); + int32_t status = distributedTableName.empty() ? RDB_ERROR : RDB_OK; + if (!ITypesUtil::Marshal(reply, status, distributedTableName)) { ZLOGE("Marshal distributedTableName:%{public}s", distributedTableName.c_str()); return IPC_STUB_WRITE_PARCEL_ERR; } diff --git a/services/distributeddataservice/service/test/BUILD.gn b/services/distributeddataservice/service/test/BUILD.gn index 9955ea5e3c3171874b3d1d5cbb783362c34fb481..e9d0d0a84bfb23523fe8678f0c72907a5725c0f8 100644 --- a/services/distributeddataservice/service/test/BUILD.gn +++ b/services/distributeddataservice/service/test/BUILD.gn @@ -67,8 +67,6 @@ ohos_unittest("CloudDataTest") { } module_out_path = module_output_path sources = [ - "${data_service_path}/service/backup/src/backup_manager.cpp", - "${data_service_path}/service/bootstrap/src/bootstrap.cpp", "${data_service_path}/service/cloud/cloud_data_translate.cpp", "${data_service_path}/service/cloud/cloud_service_impl.cpp", "${data_service_path}/service/cloud/cloud_service_stub.cpp", @@ -76,42 +74,6 @@ ohos_unittest("CloudDataTest") { "${data_service_path}/service/cloud/cloud_value_util.cpp", "${data_service_path}/service/cloud/sync_manager.cpp", "${data_service_path}/service/cloud/sync_strategies/network_sync_strategy.cpp", - "${data_service_path}/service/common/common_types_utils.cpp", - "${data_service_path}/service/common/value_proxy.cpp", - "${data_service_path}/service/common/xcollie.cpp", - "${data_service_path}/service/config/src/config_factory.cpp", - "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", - "${data_service_path}/service/config/src/model/backup_config.cpp", - "${data_service_path}/service/config/src/model/checker_config.cpp", - "${data_service_path}/service/config/src/model/cloud_config.cpp", - "${data_service_path}/service/config/src/model/component_config.cpp", - "${data_service_path}/service/config/src/model/datashare_config.cpp", - "${data_service_path}/service/config/src/model/device_sync_app_white_list_config.cpp", - "${data_service_path}/service/config/src/model/directory_config.cpp", - "${data_service_path}/service/config/src/model/global_config.cpp", - "${data_service_path}/service/config/src/model/network_config.cpp", - "${data_service_path}/service/config/src/model/protocol_config.cpp", - "${data_service_path}/service/config/src/model/thread_config.cpp", - "${data_service_path}/service/crypto/src/crypto_manager.cpp", - "${data_service_path}/service/kvdb/user_delegate.cpp", - "${data_service_path}/service/matrix/src/device_matrix.cpp", - "${data_service_path}/service/matrix/src/matrix_event.cpp", - "${data_service_path}/service/permission/src/permission_validator.cpp", - "${data_service_path}/service/permission/src/permit_delegate.cpp", - "${data_service_path}/service/rdb/cache_cursor.cpp", - "${data_service_path}/service/rdb/rdb_asset_loader.cpp", - "${data_service_path}/service/rdb/rdb_cloud.cpp", - "${data_service_path}/service/rdb/rdb_cursor.cpp", - "${data_service_path}/service/rdb/rdb_general_store.cpp", - "${data_service_path}/service/rdb/rdb_hiview_adapter.cpp", - "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", - "${data_service_path}/service/rdb/rdb_query.cpp", - "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", - "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", - "${data_service_path}/service/rdb/rdb_schema_config.cpp", - "${data_service_path}/service/rdb/rdb_service_impl.cpp", - "${data_service_path}/service/rdb/rdb_service_stub.cpp", - "${data_service_path}/service/rdb/rdb_watcher.cpp", "${data_service_path}/service/test/mock/checker_mock.cpp", "cloud_data_test.cpp", ] @@ -119,33 +81,25 @@ ohos_unittest("CloudDataTest") { configs = [ ":module_private_config" ] external_deps = [ - "ability_base:base", - "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "c_utils:utils", - "device_manager:devicemanagersdk", - "googletest:gtest_main", "hicollie:libhicollie", - "hilog:libhilog", - "hisysevent:libhisysevent", - "huks:libhukssdk", - "ipc:ipc_core", + "json:nlohmann_json_static", "kv_store:distributeddata_inner", "kv_store:distributeddb", - "netmanager_base:net_conn_manager_if", "relational_store:native_rdb", - "resource_management:global_resmgr", - "samgr:samgr_proxy", ] deps = [ "${data_service_path}/adapter/account:distributeddata_account", "${data_service_path}/adapter/communicator:distributeddata_communicator", + "${data_service_path}/adapter/dfx:distributeddata_dfx", "${data_service_path}/adapter/schema_helper:distributeddata_schema_helper", + "${data_service_path}/service/bootstrap:distributeddata_bootstrap", + "${data_service_path}/service/common:distributeddata_common", + "${data_service_path}/service/rdb:distributeddata_rdb", "${data_service_path}/framework:distributeddatasvcfwk", "mock:distributeddata_mock_static", ] @@ -165,8 +119,6 @@ ohos_unittest("CloudServiceImplTest") { } module_out_path = module_output_path sources = [ - "${data_service_path}/service/backup/src/backup_manager.cpp", - "${data_service_path}/service/bootstrap/src/bootstrap.cpp", "${data_service_path}/service/cloud/cloud_data_translate.cpp", "${data_service_path}/service/cloud/cloud_service_impl.cpp", "${data_service_path}/service/cloud/cloud_service_stub.cpp", @@ -174,42 +126,6 @@ ohos_unittest("CloudServiceImplTest") { "${data_service_path}/service/cloud/cloud_value_util.cpp", "${data_service_path}/service/cloud/sync_manager.cpp", "${data_service_path}/service/cloud/sync_strategies/network_sync_strategy.cpp", - "${data_service_path}/service/common/common_types_utils.cpp", - "${data_service_path}/service/common/value_proxy.cpp", - "${data_service_path}/service/common/xcollie.cpp", - "${data_service_path}/service/config/src/config_factory.cpp", - "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", - "${data_service_path}/service/config/src/model/backup_config.cpp", - "${data_service_path}/service/config/src/model/checker_config.cpp", - "${data_service_path}/service/config/src/model/cloud_config.cpp", - "${data_service_path}/service/config/src/model/component_config.cpp", - "${data_service_path}/service/config/src/model/datashare_config.cpp", - "${data_service_path}/service/config/src/model/device_sync_app_white_list_config.cpp", - "${data_service_path}/service/config/src/model/directory_config.cpp", - "${data_service_path}/service/config/src/model/global_config.cpp", - "${data_service_path}/service/config/src/model/network_config.cpp", - "${data_service_path}/service/config/src/model/protocol_config.cpp", - "${data_service_path}/service/config/src/model/thread_config.cpp", - "${data_service_path}/service/crypto/src/crypto_manager.cpp", - "${data_service_path}/service/kvdb/user_delegate.cpp", - "${data_service_path}/service/matrix/src/device_matrix.cpp", - "${data_service_path}/service/matrix/src/matrix_event.cpp", - "${data_service_path}/service/permission/src/permission_validator.cpp", - "${data_service_path}/service/permission/src/permit_delegate.cpp", - "${data_service_path}/service/rdb/cache_cursor.cpp", - "${data_service_path}/service/rdb/rdb_asset_loader.cpp", - "${data_service_path}/service/rdb/rdb_cloud.cpp", - "${data_service_path}/service/rdb/rdb_cursor.cpp", - "${data_service_path}/service/rdb/rdb_general_store.cpp", - "${data_service_path}/service/rdb/rdb_hiview_adapter.cpp", - "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", - "${data_service_path}/service/rdb/rdb_query.cpp", - "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", - "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", - "${data_service_path}/service/rdb/rdb_schema_config.cpp", - "${data_service_path}/service/rdb/rdb_service_impl.cpp", - "${data_service_path}/service/rdb/rdb_service_stub.cpp", - "${data_service_path}/service/rdb/rdb_watcher.cpp", "${data_service_path}/service/test/mock/checker_mock.cpp", "cloud_service_impl_test.cpp", ] @@ -217,34 +133,25 @@ ohos_unittest("CloudServiceImplTest") { configs = [ ":module_private_config" ] external_deps = [ - "ability_base:base", - "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libtoken_setproc", - "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "c_utils:utils", - "device_manager:devicemanagersdk", - "googletest:gtest_main", "hicollie:libhicollie", - "hilog:libhilog", - "hisysevent:libhisysevent", - "huks:libhukssdk", - "ipc:ipc_core", + "json:nlohmann_json_static", "kv_store:distributeddata_inner", "kv_store:distributeddb", - "netmanager_base:net_conn_manager_if", "relational_store:native_rdb", - "resource_management:global_resmgr", - "samgr:samgr_proxy", ] deps = [ "${data_service_path}/adapter/account:distributeddata_account", "${data_service_path}/adapter/communicator:distributeddata_communicator", + "${data_service_path}/adapter/dfx:distributeddata_dfx", "${data_service_path}/adapter/schema_helper:distributeddata_schema_helper", - "../../framework:distributeddatasvcfwk", + "${data_service_path}/service/bootstrap:distributeddata_bootstrap", + "${data_service_path}/service/common:distributeddata_common", + "${data_service_path}/service/rdb:distributeddata_rdb", + "${data_service_path}/framework:distributeddatasvcfwk", "mock:distributeddata_mock_static", ] @@ -850,13 +757,13 @@ ohos_unittest("ObjectManagerTest") { ] include_dirs = [ - "${dataobject_path}/frameworks/innerkitsimpl/include", + "${data_service_path}/adapter/include/utils", "${data_service_path}/app/src", "${data_service_path}/service/common", - "${dataobject_path}/frameworks/innerkitsimpl/include/common", - "${dataobject_path}/interfaces/innerkits", - "${data_service_path}/adapter/include/utils", "${data_service_path}/service/test/mock", + "${dataobject_path}/interfaces/innerkits", + "${dataobject_path}/frameworks/innerkitsimpl/include", + "${dataobject_path}/frameworks/innerkitsimpl/include/common", ] configs = [ ":module_private_config" ] @@ -993,9 +900,6 @@ ohos_unittest("UdmfRunTimeStoreTest") { "${data_service_path}/service/udmf", "${data_service_path}/service/udmf/store", "${data_service_path}/service/udmf/preprocess", - "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", - "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", - "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", ] configs = [ ":module_private_config" ] @@ -1024,7 +928,6 @@ ohos_unittest("UdmfRunTimeStoreTest") { ] deps = [ - "${data_service_path}/adapter/communicator:distributeddata_communicator", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${data_service_path}/service/udmf:udmf_server", @@ -1714,6 +1617,7 @@ ohos_unittest("BootStrapMockTest") { "${data_service_path}/adapter/communicator:distributeddata_communicator", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service/backup:distributeddata_backup", + "${data_service_path}/framework:distributeddatasvcfwk", ] cflags = [ diff --git a/services/distributeddataservice/service/test/cloud_data_test.cpp b/services/distributeddataservice/service/test/cloud_data_test.cpp index c73a92d27ef9627ea67e0df589ede90bca831b38..f62d10e4df4d049a9e8dcc96d47a1dab8246a594 100644 --- a/services/distributeddataservice/service/test/cloud_data_test.cpp +++ b/services/distributeddataservice/service/test/cloud_data_test.cpp @@ -45,7 +45,7 @@ #include "metadata/store_meta_data_local.h" #include "mock/db_store_mock.h" #include "mock/general_store_mock.h" -#include "network_delegate.h" +#include "network/network_delegate.h" #include "network_delegate_mock.h" #include "rdb_query.h" #include "rdb_service.h" diff --git a/services/distributeddataservice/service/test/cloud_service_impl_test.cpp b/services/distributeddataservice/service/test/cloud_service_impl_test.cpp index 7f1ca2f0f722744805ee2d68af4ad6df043ccf3f..0a501550daaa87cbc9d22d1a512a3c55ab9ae726 100644 --- a/services/distributeddataservice/service/test/cloud_service_impl_test.cpp +++ b/services/distributeddataservice/service/test/cloud_service_impl_test.cpp @@ -42,7 +42,7 @@ #include "mock/db_store_mock.h" #include "mock/general_store_mock.h" #include "model/component_config.h" -#include "network_delegate.h" +#include "network/network_delegate.h" #include "network_delegate_mock.h" #include "rdb_query.h" #include "rdb_service.h" diff --git a/services/distributeddataservice/service/test/fuzztest/cloudservicestub_fuzzer/BUILD.gn b/services/distributeddataservice/service/test/fuzztest/cloudservicestub_fuzzer/BUILD.gn index ca4c9f00502e6f43a21f481cf2f3be90f6e42475..55b263a748d9bfab4810b52d5338fed2cb4fb987 100644 --- a/services/distributeddataservice/service/test/fuzztest/cloudservicestub_fuzzer/BUILD.gn +++ b/services/distributeddataservice/service/test/fuzztest/cloudservicestub_fuzzer/BUILD.gn @@ -20,11 +20,6 @@ ohos_fuzztest("CloudServiceStubFuzzTest") { module_out_path = "datamgr_service/datamgr_service" include_dirs = [ - "${data_service_path}/adapter/include", - "${data_service_path}/app/src", - "${data_service_path}/framework/include", - "${data_service_path}/service/backup/include", - "${data_service_path}/service/bootstrap/include", "${data_service_path}/service/cloud", "${data_service_path}/service/common", "${data_service_path}/service/config/include", @@ -35,24 +30,9 @@ ohos_fuzztest("CloudServiceStubFuzzTest") { "${data_service_path}/service/object", "${data_service_path}/service/permission/include", "${data_service_path}/service/rdb", - "${kv_store_common_path}", - "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", - "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", - "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", - "${kv_store_distributeddb_path}", - "${kv_store_distributeddb_path}/include/", - "${kv_store_distributeddb_path}/interfaces/include/", - "${kv_store_distributeddb_path}/interfaces/include/relational", - "${dataobject_path}/frameworks/innerkitsimpl/include", - "${relational_store_path}/interfaces/inner_api/cloud_data/include", - "${relational_store_path}/interfaces/inner_api/rdb/include", - "${relational_store_path}/interfaces/inner_api/common_type/include", - "//third_party/json/single_include", - "${data_service_path}/adapter/include/communicator", ] - fuzz_config_file = - "${data_service_path}/service/test/fuzztest/cloudservicestub_fuzzer" + fuzz_config_file = "${data_service_path}/service/test/fuzztest/cloudservicestub_fuzzer" cflags = [ "-g", @@ -64,67 +44,24 @@ ohos_fuzztest("CloudServiceStubFuzzTest") { sources = [ "${data_service_path}/app/src/checker/bundle_checker.cpp", "${data_service_path}/app/src/checker/system_checker.cpp", - "${data_service_path}/service/backup/src/backup_manager.cpp", - "${data_service_path}/service/bootstrap/src/bootstrap.cpp", - "${data_service_path}/service/cloud/cloud_data_translate.cpp", - "${data_service_path}/service/cloud/cloud_service_impl.cpp", - "${data_service_path}/service/cloud/cloud_service_stub.cpp", - "${data_service_path}/service/cloud/cloud_types_util.cpp", - "${data_service_path}/service/cloud/cloud_value_util.cpp", - "${data_service_path}/service/cloud/sync_manager.cpp", - "${data_service_path}/service/cloud/sync_strategies/network_sync_strategy.cpp", - "${data_service_path}/service/common/common_types_utils.cpp", - "${data_service_path}/service/common/value_proxy.cpp", - "${data_service_path}/service/common/xcollie.cpp", - "${data_service_path}/service/config/src/config_factory.cpp", - "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", - "${data_service_path}/service/config/src/model/backup_config.cpp", - "${data_service_path}/service/config/src/model/checker_config.cpp", - "${data_service_path}/service/config/src/model/cloud_config.cpp", - "${data_service_path}/service/config/src/model/component_config.cpp", - "${data_service_path}/service/config/src/model/datashare_config.cpp", - "${data_service_path}/service/config/src/model/device_sync_app_white_list_config.cpp", - "${data_service_path}/service/config/src/model/directory_config.cpp", - "${data_service_path}/service/config/src/model/global_config.cpp", - "${data_service_path}/service/config/src/model/network_config.cpp", - "${data_service_path}/service/config/src/model/protocol_config.cpp", - "${data_service_path}/service/config/src/model/thread_config.cpp", - "${data_service_path}/service/crypto/src/crypto_manager.cpp", - "${data_service_path}/service/kvdb/user_delegate.cpp", - "${data_service_path}/service/permission/src/permission_validator.cpp", - "${data_service_path}/service/permission/src/permit_delegate.cpp", - "${data_service_path}/service/rdb/cache_cursor.cpp", - "${data_service_path}/service/rdb/rdb_asset_loader.cpp", - "${data_service_path}/service/rdb/rdb_cloud.cpp", - "${data_service_path}/service/rdb/rdb_cursor.cpp", - "${data_service_path}/service/rdb/rdb_general_store.cpp", - "${data_service_path}/service/rdb/rdb_hiview_adapter.cpp", - "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", - "${data_service_path}/service/rdb/rdb_query.cpp", - "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", - "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", - "${data_service_path}/service/rdb/rdb_schema_config.cpp", - "${data_service_path}/service/rdb/rdb_service_impl.cpp", - "${data_service_path}/service/rdb/rdb_service_stub.cpp", - "${data_service_path}/service/rdb/rdb_watcher.cpp", "cloudservicestub_fuzzer.cpp", ] deps = [ "${data_service_path}/adapter/account:distributeddata_account", + "${data_service_path}/adapter/dfx:distributeddata_dfx", "${data_service_path}/adapter/network:distributeddata_network", "${data_service_path}/adapter/schema_helper:distributeddata_schema_helper", "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", - "${data_service_path}/service:distributeddatasvc", + "${data_service_path}/service/bootstrap:distributeddata_bootstrap", + "${data_service_path}/service/cloud:distributeddata_cloud", + "${data_service_path}/service/common:distributeddata_common", + "${data_service_path}/service/rdb:distributeddata_rdb", "${kv_store_distributeddb_path}:distributeddb", ] external_deps = [ - "ability_base:want", - "ability_base:zuri", - "ability_runtime:ability_manager", - "ability_runtime:dataobs_manager", "access_token:libaccesstoken_sdk", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", @@ -135,9 +72,9 @@ ohos_fuzztest("CloudServiceStubFuzzTest") { "device_manager:devicemanagersdk", "hicollie:libhicollie", "hilog:libhilog", - "hisysevent:libhisysevent", "huks:libhukssdk", "ipc:ipc_core", + "kv_store:datamgr_common", "kv_store:distributeddata_inner", "kv_store:distributeddata_mgr", "relational_store:native_rdb", diff --git a/services/distributeddataservice/service/test/fuzztest/rdbservicestub_fuzzer/BUILD.gn b/services/distributeddataservice/service/test/fuzztest/rdbservicestub_fuzzer/BUILD.gn index e9d34a5d4a598a535c27086e462f96e83ef44e55..d8f90d8320d4f05b161aad8fa1cee0e0af049493 100644 --- a/services/distributeddataservice/service/test/fuzztest/rdbservicestub_fuzzer/BUILD.gn +++ b/services/distributeddataservice/service/test/fuzztest/rdbservicestub_fuzzer/BUILD.gn @@ -64,48 +64,19 @@ ohos_fuzztest("RdbServiceStubFuzzTest") { sources = [ "${data_service_path}/app/src/checker/bundle_checker.cpp", "${data_service_path}/app/src/checker/system_checker.cpp", - "${data_service_path}/service/backup/src/backup_manager.cpp", - "${data_service_path}/service/bootstrap/src/bootstrap.cpp", - "${data_service_path}/service/common/value_proxy.cpp", - "${data_service_path}/service/common/xcollie.cpp", - "${data_service_path}/service/config/src/config_factory.cpp", - "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", - "${data_service_path}/service/config/src/model/backup_config.cpp", - "${data_service_path}/service/config/src/model/checker_config.cpp", - "${data_service_path}/service/config/src/model/cloud_config.cpp", - "${data_service_path}/service/config/src/model/component_config.cpp", - "${data_service_path}/service/config/src/model/datashare_config.cpp", - "${data_service_path}/service/config/src/model/device_sync_app_white_list_config.cpp", - "${data_service_path}/service/config/src/model/directory_config.cpp", - "${data_service_path}/service/config/src/model/global_config.cpp", - "${data_service_path}/service/config/src/model/network_config.cpp", - "${data_service_path}/service/config/src/model/protocol_config.cpp", - "${data_service_path}/service/config/src/model/thread_config.cpp", - "${data_service_path}/service/crypto/src/crypto_manager.cpp", - "${data_service_path}/service/rdb/cache_cursor.cpp", - "${data_service_path}/service/rdb/rdb_asset_loader.cpp", - "${data_service_path}/service/rdb/rdb_cloud.cpp", - "${data_service_path}/service/rdb/rdb_cursor.cpp", - "${data_service_path}/service/rdb/rdb_general_store.cpp", - "${data_service_path}/service/rdb/rdb_hiview_adapter.cpp", - "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", - "${data_service_path}/service/rdb/rdb_query.cpp", - "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", - "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", - "${data_service_path}/service/rdb/rdb_schema_config.cpp", - "${data_service_path}/service/rdb/rdb_service_impl.cpp", - "${data_service_path}/service/rdb/rdb_service_stub.cpp", - "${data_service_path}/service/rdb/rdb_watcher.cpp", "rdbservicestub_fuzzer.cpp", ] deps = [ "${data_service_path}/adapter/account:distributeddata_account", + "${data_service_path}/adapter/dfx:distributeddata_dfx", "${data_service_path}/adapter/utils:distributeddata_utils", "${data_service_path}/framework:distributeddatasvcfwk", - "${data_service_path}/service:distributeddatasvc", + "${data_service_path}/service/bootstrap:distributeddata_bootstrap", + "${data_service_path}/service/cloud:distributeddata_cloud", + "${data_service_path}/service/common:distributeddata_common", + "${data_service_path}/service/rdb:distributeddata_rdb", "${kv_store_distributeddb_path}:distributeddb", - "${relational_store_inner_api_path}:native_rdb_static", ] external_deps = [ @@ -122,7 +93,6 @@ ohos_fuzztest("RdbServiceStubFuzzTest") { "device_manager:devicemanagersdk", "hicollie:libhicollie", "hilog:libhilog", - "hisysevent:libhisysevent", "huks:libhukssdk", "ipc:ipc_core", "kv_store:distributeddata_inner", diff --git a/services/distributeddataservice/service/test/kvdb_service_impl_test.cpp b/services/distributeddataservice/service/test/kvdb_service_impl_test.cpp index 3422fe5c5df2f80d0db2b334ca32885193f80de3..1717b304fab8b643d6bc0300022a964084c8873d 100644 --- a/services/distributeddataservice/service/test/kvdb_service_impl_test.cpp +++ b/services/distributeddataservice/service/test/kvdb_service_impl_test.cpp @@ -37,7 +37,7 @@ #include "mock/access_token_mock.h" #include "mock/meta_data_manager_mock.h" #include "nativetoken_kit.h" -#include "network_delegate.h" +#include "network/network_delegate.h" #include "network_delegate_mock.h" #include "token_setproc.h" #include "types.h" diff --git a/services/distributeddataservice/service/test/mock/account_delegate_mock.h b/services/distributeddataservice/service/test/mock/account_delegate_mock.h index fe8af6baf5fb018464973437063545139404046c..1207f6392a2945f63bd39406541a8f1ca318c56e 100644 --- a/services/distributeddataservice/service/test/mock/account_delegate_mock.h +++ b/services/distributeddataservice/service/test/mock/account_delegate_mock.h @@ -18,7 +18,7 @@ #include #include -#include "account_delegate.h" +#include "account/account_delegate.h" namespace OHOS { namespace DistributedData { class AccountDelegateMock : public AccountDelegate { diff --git a/services/distributeddataservice/service/test/mock/network_delegate_mock.h b/services/distributeddataservice/service/test/mock/network_delegate_mock.h index 5e199efbeccc66d5a2dc408c16ed48374da1bc5b..0fcea3d287c291d3f87929eff26337fdcac7fc63 100644 --- a/services/distributeddataservice/service/test/mock/network_delegate_mock.h +++ b/services/distributeddataservice/service/test/mock/network_delegate_mock.h @@ -15,7 +15,7 @@ #ifndef OHOS_NETWORK_DELEGATE_MOCK_H #define OHOS_NETWORK_DELEGATE_MOCK_H -#include "network_delegate.h" +#include "network/network_delegate.h" namespace OHOS { namespace DistributedData { diff --git a/services/distributeddataservice/service/test/rdb_service_impl_test.cpp b/services/distributeddataservice/service/test/rdb_service_impl_test.cpp index 7d6416dcbd743a486457412d7a17d3f2b8567725..07a17355416fa8790140b17478c651cb4a4f58e2 100644 --- a/services/distributeddataservice/service/test/rdb_service_impl_test.cpp +++ b/services/distributeddataservice/service/test/rdb_service_impl_test.cpp @@ -239,7 +239,8 @@ HWTEST_F(RdbServiceImplTest, ResolveAutoLaunch006, TestSize.Level0) EXPECT_EQ(MetaDataManager::GetInstance().SaveMeta(metaData_.GetKey(), metaData_, false), true); RdbServiceImpl service; auto deviceId = DmAdapter::GetInstance().GetLocalDevice().uuid; - auto ret = service.ObtainDistributedTableName(deviceId, TEST_STORE); + RdbSyncerParam param; + auto ret = service.ObtainDistributedTableName(param, deviceId, TEST_STORE); EXPECT_GT(ret.length(), 0); EXPECT_EQ(MetaDataManager::GetInstance().DelMeta(metaData_.GetKey(), false), true); } @@ -255,7 +256,8 @@ HWTEST_F(RdbServiceImplTest, ObtainDistributedTableName001, TestSize.Level0) { EXPECT_EQ(MetaDataManager::GetInstance().SaveMeta(metaData_.GetKey(), metaData_, false), true); RdbServiceImpl service; - auto ret = service.ObtainDistributedTableName("invalid_device_id", TEST_STORE); + RdbSyncerParam param; + auto ret = service.ObtainDistributedTableName(param, "invalid_device_id", TEST_STORE); EXPECT_EQ(ret.length(), 0); EXPECT_EQ(MetaDataManager::GetInstance().DelMeta(metaData_.GetKey(), false), true); } diff --git a/services/distributeddataservice/service/udmf/store/store_account_observer.h b/services/distributeddataservice/service/udmf/store/store_account_observer.h index f7ebd8f7cc9bda43bbb4bbae4c4e0d356b2608b4..3d50570b9a24bef13b8256dd0c0d90ef5b5ae4ec 100644 --- a/services/distributeddataservice/service/udmf/store/store_account_observer.h +++ b/services/distributeddataservice/service/udmf/store/store_account_observer.h @@ -15,7 +15,7 @@ #ifndef STORE_ACCOUNT_OBSERVER_H #define STORE_ACCOUNT_OBSERVER_H -#include "account_delegate.h" +#include "account/account_delegate.h" namespace OHOS { namespace UDMF { class RuntimeStoreAccountObserver : public DistributedData::AccountDelegate::Observer { diff --git a/services/distributeddataservice/service/udmf/udmf_service_impl.cpp b/services/distributeddataservice/service/udmf/udmf_service_impl.cpp index 42ef97a5d3a3385b69f5e8793a8b8eb184fc1e71..45fb4f7eec9815482de746204b16b121123ee37d 100644 --- a/services/distributeddataservice/service/udmf/udmf_service_impl.cpp +++ b/services/distributeddataservice/service/udmf/udmf_service_impl.cpp @@ -32,7 +32,7 @@ #include "metadata/store_meta_data.h" #include "metadata/meta_data_manager.h" #include "preprocess_utils.h" -#include "reporter.h" +#include "dfx/reporter.h" #include "store_account_observer.h" #include "system_ability_definition.h" #include "uri_permission_manager.h"