diff --git a/services/distributeddataservice/framework/BUILD.gn b/services/distributeddataservice/framework/BUILD.gn index d26ce33441340c15a0f1281a19625442a5a7e992..98a05fb2a7ba221ed61decabb569ca7715538a43 100644 --- a/services/distributeddataservice/framework/BUILD.gn +++ b/services/distributeddataservice/framework/BUILD.gn @@ -17,7 +17,7 @@ import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") group("build_module") { deps = [ ":distributeddatasvcfwk" ] } -config("module_public_config") { +config("module_config") { visibility = [ ":*" ] include_dirs = [ "include", @@ -31,6 +31,15 @@ config("module_public_config") { ] } +config("module_public_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", + "//third_party/json/single_include", + "${kv_store_common_path}", + ] +} + ohos_shared_library("distributeddatasvcfwk") { sources = [ "backuprule/backup_rule_manager.cpp", @@ -67,7 +76,9 @@ ohos_shared_library("distributeddatasvcfwk") { cflags_cc = [ "-fvisibility=hidden" ] - configs = [ ":module_public_config" ] + configs = [ ":module_config" ] + + public_configs = [ ":module_public_config" ] deps = [ "//third_party/openssl:libcrypto_shared" ] diff --git a/services/distributeddataservice/framework/cloud/cloud_db.cpp b/services/distributeddataservice/framework/cloud/cloud_db.cpp index 6525a4f09a52159f5b10f557b47f01d0fcdd909a..dd149f8e21c61e173b0d881c490339f047e7f2fc 100644 --- a/services/distributeddataservice/framework/cloud/cloud_db.cpp +++ b/services/distributeddataservice/framework/cloud/cloud_db.cpp @@ -70,6 +70,11 @@ int32_t CloudDB::Unlock() return E_NOT_SUPPORT; } +int64_t CloudDB::AliveTime() +{ + return -1; +} + int32_t CloudDB::Close() { return E_NOT_SUPPORT; diff --git a/services/distributeddataservice/framework/cloud/cloud_server.cpp b/services/distributeddataservice/framework/cloud/cloud_server.cpp index a2e0f7164cc131142c04e71d11a601d7156c3760..17c704a1b3fcf1a9dc109be2dfe503b549dc51c1 100644 --- a/services/distributeddataservice/framework/cloud/cloud_server.cpp +++ b/services/distributeddataservice/framework/cloud/cloud_server.cpp @@ -40,6 +40,16 @@ SchemaMeta CloudServer::GetAppSchema(int32_t userId, const std::string &bundleNa return SchemaMeta(); } +int32_t CloudServer::Subscribe(int32_t userId, const std::map> &dbs) +{ + return 0; +} + +int32_t CloudServer::Unsubscribe(int32_t userId, const std::map> &dbs) +{ + return 0; +} + std::shared_ptr CloudServer::ConnectAssetLoader(uint32_t tokenId, const CloudServer::Database &dbMeta) { return nullptr; diff --git a/services/distributeddataservice/framework/include/cloud/cloud_db.h b/services/distributeddataservice/framework/include/cloud/cloud_db.h index 57d15f5cfb6a96c1e81da4f53be07533d0f9c3d9..4882d8d7fef83b989eff0ca7774c15ae0b05c170 100644 --- a/services/distributeddataservice/framework/include/cloud/cloud_db.h +++ b/services/distributeddataservice/framework/include/cloud/cloud_db.h @@ -28,6 +28,8 @@ public: using Watcher = GeneralWatcher; using Async = std::function>)>; using Devices = std::vector; + virtual ~CloudDB() = default; + virtual int32_t Execute(const std::string &table, const std::string &sql, const VBucket &extend); virtual int32_t BatchInsert(const std::string &table, VBuckets &&values, VBuckets &extends); @@ -50,6 +52,8 @@ public: virtual int32_t Unlock(); + virtual int64_t AliveTime(); + virtual int32_t Close(); }; } // namespace OHOS::DistributedData diff --git a/services/distributeddataservice/framework/include/cloud/cloud_server.h b/services/distributeddataservice/framework/include/cloud/cloud_server.h index eee93713e30b9facf7d7672c5cdaf20572b92316..709a0cbcf67c76fe768b1c3f58672ec3a2ce8754 100644 --- a/services/distributeddataservice/framework/include/cloud/cloud_server.h +++ b/services/distributeddataservice/framework/include/cloud/cloud_server.h @@ -29,6 +29,8 @@ public: virtual CloudInfo GetServerInfo(int32_t userId); virtual SchemaMeta GetAppSchema(int32_t userId, const std::string &bundleName); + virtual int32_t Subscribe(int32_t userId, const std::map> &dbs); + virtual int32_t Unsubscribe(int32_t userId, const std::map> &dbs); virtual std::shared_ptr ConnectAssetLoader(uint32_t tokenId, const Database &dbMeta); virtual std::shared_ptr ConnectCloudDB(uint32_t tokenId, const Database &dbMeta);