From 5880a9ccfc814801894c7976e12f30f8592546a6 Mon Sep 17 00:00:00 2001 From: czy Date: Mon, 30 Jun 2025 21:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=8D=B8=E8=BD=BD=E6=97=B6?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: czy Change-Id: I49a11356c290d98b6a4a348c8eb44a77e8b4b4e4 --- .../data_share/common/proxy_data_manager.cpp | 269 ++++++++++++++++-- .../data_share/common/proxy_data_manager.h | 37 ++- .../data_share/data_share_service_impl.cpp | 14 +- .../data_share/data_share_service_impl.h | 4 + .../data_share/data_share_service_stub.cpp | 1 + .../data_share/sys_event_subscriber.cpp | 12 + .../service/data_share/sys_event_subscriber.h | 2 + 7 files changed, 307 insertions(+), 32 deletions(-) diff --git a/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp b/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp index 1a87b77b2..7e83b2df9 100644 --- a/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp +++ b/services/distributeddataservice/service/data_share/common/proxy_data_manager.cpp @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #define LOG_TAG "ProxyDataManager" #include "datashare_observer.h" @@ -31,6 +32,26 @@ ProxyDataManager &ProxyDataManager::GetInstance() return instance; } +ProxyDataList::ProxyDataList(const ProxyDataListNode &node) + : KvData(Id(std::to_string(node.tokenId), node.userId)), value(node) +{ +} + +bool ProxyDataList::HasVersion() const +{ + return true; +} + +int ProxyDataList::GetVersion() const +{ + return value.GetVersion(); +} + +std::string ProxyDataList::GetValue() const +{ + return DistributedData::Serializable::Marshall(value); +} + PublishedProxyData::PublishedProxyData(const ProxyDataNode &node) : KvData(Id(node.proxyData.uri, node.userId)), value(node) { @@ -51,14 +72,14 @@ std::string PublishedProxyData::GetValue() const return DistributedData::Serializable::Marshall(value); } +ProxyDataListNode::ProxyDataListNode() : VersionData(-1) {} + ProxyDataNode::ProxyDataNode() : VersionData(-1) {} bool ProxyDataNode::Marshal(DistributedData::Serializable::json &node) const { bool ret = SetValue(node[GET_NAME(proxyData)], proxyData); - ret = ret && SetValue(node[GET_NAME(bundleName)], bundleName); ret = ret && SetValue(node[GET_NAME(userId)], userId); - ret = ret && SetValue(node[GET_NAME(appIndex)], appIndex); ret = ret && SetValue(node[GET_NAME(tokenId)], tokenId); return ret && VersionData::Marshal(node); } @@ -66,23 +87,36 @@ bool ProxyDataNode::Marshal(DistributedData::Serializable::json &node) const bool ProxyDataNode::Unmarshal(const DistributedData::Serializable::json &node) { bool ret = GetValue(node, GET_NAME(proxyData), proxyData); - ret = ret && GetValue(node, GET_NAME(bundleName), bundleName); ret = ret && GetValue(node, GET_NAME(userId), userId); - ret = ret && GetValue(node, GET_NAME(appIndex), appIndex); + return ret && GetValue(node, GET_NAME(tokenId), tokenId); +} + +bool ProxyDataListNode::Marshal(DistributedData::Serializable::json &node) const +{ + bool ret = SetValue(node[GET_NAME(uris)], uris); + ret = ret && SetValue(node[GET_NAME(userId)], userId); + ret = ret && SetValue(node[GET_NAME(tokenId)], tokenId); + return ret && VersionData::Marshal(node); +} + +bool ProxyDataListNode::Unmarshal(const DistributedData::Serializable::json &node) +{ + bool ret = GetValue(node, GET_NAME(uris), uris); + ret = ret && GetValue(node, GET_NAME(userId), userId); return ret && GetValue(node, GET_NAME(tokenId), tokenId); } bool PublishedProxyData::VerifySelfAccess(const BundleInfo &callerBundleInfo, const ProxyDataNode &data, bool isInstallEvent) { - std::string bundleName; - URIUtils::GetBundleNameFromProxyURI(data.proxyData.uri, bundleName); - if (callerBundleInfo.bundleName == bundleName && callerBundleInfo.appIndex == data.appIndex && - callerBundleInfo.userId == data.userId) { - return true; - } - ZLOGE("only allow to modify the proxyData of self bundle"); - return false; + // std::string bundleName; + // URIUtils::GetBundleNameFromProxyURI(data.proxyData.uri, bundleName); + // if (callerBundleInfo.bundleName == bundleName && callerBundleInfo.appIndex == data.appIndex && + // callerBundleInfo.userId == data.userId) { + // return true; + // } + // ZLOGE("only allow to modify the proxyData of self bundle"); + return callerBundleInfo.tokenId == data.tokenId; } bool PublishedProxyData::VerifyPermission(const BundleInfo &callerBundleInfo, const ProxyDataNode &data) @@ -140,11 +174,23 @@ int32_t PublishedProxyData::Upsert(const DataShareProxyData &proxyData, const Bu return INNER_ERROR; } + ProxyDataListNode proxyDataList; std::string filter = Id(proxyData.uri_, callerBundleInfo.userId); std::string queryResult; delegate->Get(KvDBDelegate::PROXYDATA_TABLE, filter, "{}", queryResult); - if (queryResult.empty()) { + std::string listFilter = Id(std::to_string(callerBundleInfo.tokenId), callerBundleInfo.userId); + std::string listQueryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, listFilter, "{}", listQueryResult); + if (!listQueryResult.empty()) { + if (!ProxyDataListNode::Unmarshall(listQueryResult, proxyDataList)) { + ZLOGE("Unmarshall failed, %{private}s", listQueryResult.c_str()); + return INNER_ERROR; + } + if (proxyDataList.uris.size() >= PROXY_DATA_MAX_COUNT) { + return OVER_LIMIT; + } + } type = DataShareObserver::ChangeType::INSERT; std::string modifyBundle; URIUtils::GetBundleNameFromProxyURI(proxyData.uri_, modifyBundle); @@ -162,16 +208,26 @@ int32_t PublishedProxyData::Upsert(const DataShareProxyData &proxyData, const Bu return NO_PERMISSION; } } + SerialDataShareProxyData serialProxyData(proxyData.uri_, proxyData.value_, proxyData.allowList_); - auto [status, count] = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, PublishedProxyData(ProxyDataNode( - serialProxyData, callerBundleInfo.bundleName, callerBundleInfo.userId, - callerBundleInfo.appIndex, callerBundleInfo.tokenId))); - if (status != E_OK) { + auto ret = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, PublishedProxyData(ProxyDataNode( + serialProxyData, callerBundleInfo.userId, callerBundleInfo.tokenId))); + if (ret.first != E_OK) { ZLOGE("db Upsert failed, %{public}s %{public}d", - URIUtils::Anonymous(proxyData.uri_).c_str(), status); + URIUtils::Anonymous(proxyData.uri_).c_str(), ret.first); type = DataShareObserver::ChangeType::INVAILD; return INNER_ERROR; } + auto it = std::find(proxyDataList.uris.begin(), proxyDataList.uris.end(), proxyData.uri_); + if (it == proxyDataList.uris.end()) { + proxyDataList.uris.emplace_back(proxyData.uri_); + } + ret = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, ProxyDataList(ProxyDataListNode( + proxyDataList.uris, callerBundleInfo.userId, callerBundleInfo.tokenId))); + if (ret.first != E_OK) { + ZLOGE("db Upsert failed, %{public}x %{public}d", callerBundleInfo.tokenId, callerBundleInfo.userId); + return INNER_ERROR; + } type = DataShareObserver::ChangeType::UPDATE; return SUCCESS; } @@ -209,16 +265,157 @@ int32_t PublishedProxyData::Delete(const std::string &uri, const BundleInfo &cal oldProxyData.uri_ = oldData.proxyData.uri; oldProxyData.value_ = oldData.proxyData.value; oldProxyData.allowList_ = oldData.proxyData.allowList; - auto [status, count] = delegate->Delete(KvDBDelegate::PROXYDATA_TABLE, filter); - if (status != E_OK) { - ZLOGE("db Delete failed, %{public}s %{public}d", filter.c_str(), status); + auto ret = delegate->Delete(KvDBDelegate::PROXYDATA_TABLE, filter); + if (ret.first != E_OK) { + ZLOGE("db Delete failed, %{public}s %{public}d", filter.c_str(), ret.first); type = DataShareObserver::ChangeType::INVAILD; return INNER_ERROR; } + std::string listFilter = Id(std::to_string(callerBundleInfo.tokenId), callerBundleInfo.userId); + std::string listQueryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, listFilter, "{}", listQueryResult); + if (listQueryResult.empty()) { + return INNER_ERROR; + } + + ProxyDataListNode node; + if (!ProxyDataListNode::Unmarshall(listQueryResult, node)) { + ZLOGE("Unmarshall failed, %{private}s", listQueryResult.c_str()); + return INNER_ERROR; + } + auto it = std::find(node.uris.begin(), node.uris.end(), uri); + if (it != node.uris.end()) { + node.uris.erase(it); + } + ret = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, ProxyDataList(ProxyDataListNode( + node.uris, callerBundleInfo.userId, callerBundleInfo.tokenId))); + if (ret.first != E_OK) { + ZLOGE("db Upsert failed, %{public}x %{public}d", callerBundleInfo.tokenId, ret.first); + return INNER_ERROR; + } type = DataShareObserver::ChangeType::DELETE; return SUCCESS; } +int32_t ProxyDataList::GetProxyDataCount(const uint32_t &tokenId, const int32_t &userId) +{ + int32_t defaultNum = 0; + auto delegate = KvDBDelegate::GetInstance(); + if (delegate == nullptr) { + ZLOGE("db open failed"); + return defaultNum; + } + + std::string filter = Id(std::to_string(tokenId), userId); + std::string queryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, filter, "{}", queryResult); + if (queryResult.empty()) { + return defaultNum; + } + ProxyDataListNode data; + if (!ProxyDataListNode::Unmarshall(queryResult, data)) { + ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + return defaultNum; + } + + return data.uris.size(); +} + +int32_t ProxyDataList::Query(const uint32_t &tokenId, const int32_t &userId, std::vector &proxyDataList) +{ + int32_t defaultNum = 0; + auto delegate = KvDBDelegate::GetInstance(); + if (delegate == nullptr) { + ZLOGE("db open failed"); + return defaultNum; + } + std::string filter = Id(std::to_string(tokenId), userId); + std::string queryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, filter, "{}", queryResult); + if (queryResult.empty()) { + return defaultNum; + } + ProxyDataListNode data; + if (!ProxyDataListNode::Unmarshall(queryResult, data)) { + ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + return defaultNum; + } + + proxyDataList = std::move(data.uris); + return data.uris.size(); +} + +int32_t ProxyDataList::Upsert(const std::vector &uris, const uint32_t &tokenId, const int32_t &userId) +{ + int32_t defaultNum = 0; + auto delegate = KvDBDelegate::GetInstance(); + if (delegate == nullptr) { + ZLOGE("db open failed"); + return defaultNum; + } + + std::string filter = Id(std::to_string(tokenId), userId); + std::string queryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, filter, "{}", queryResult); + ProxyDataListNode node; + if (queryResult.empty()) { + return defaultNum; + } else if (!ProxyDataListNode::Unmarshall(queryResult, node)){ + ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + return defaultNum; + } + std::for_each(uris.begin(), uris.end(), [&node](const auto &uri) { + auto it = std::find(node.uris.begin(), node.uris.end(), uri); + if (it != node.uris.end()) { + return; + } + node.uris.emplace_back(uri); + }); + auto [status, res] = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, ProxyDataList(ProxyDataListNode( + node.uris, userId, tokenId))); + if (status != E_OK) { + ZLOGE("db Upsert failed, %{public}x %{public}d", tokenId, status); + return defaultNum; + } + return res; +} + +int32_t ProxyDataList::Delete(const std::vector uris, const uint32_t &tokenId, const int32_t &userId) +{ + int32_t defaultNum = 0; + auto delegate = KvDBDelegate::GetInstance(); + if (delegate == nullptr) { + ZLOGE("db open failed"); + return defaultNum; + } + + std::string filter = Id(std::to_string(tokenId), userId); + std::string queryResult; + delegate->Get(KvDBDelegate::PROXYDATA_TABLE, filter, "{}", queryResult); + if (queryResult.empty()) { + return defaultNum; + } + + ProxyDataListNode node; + if (!ProxyDataListNode::Unmarshall(queryResult, node)) { + ZLOGE("Unmarshall failed, %{private}s", queryResult.c_str()); + return defaultNum; + } + std::for_each(uris.begin(), uris.end(), [&node](const auto &uri) { + auto it = std::find(node.uris.begin(), node.uris.end(), uri); + if (it != node.uris.end()) { + node.uris.erase(it); + } + }); + auto [status, res] = delegate->Upsert(KvDBDelegate::PROXYDATA_TABLE, ProxyDataList(ProxyDataListNode( + node.uris, userId, tokenId))); + if (status != E_OK) { + ZLOGE("db Upsert failed, %{public}x %{public}d", tokenId, status); + return defaultNum; + } + return res; +} + bool ProxyDataManager::GetCrossAppSharedConfig(const std::string &bundleName, int32_t user, int32_t index, std::vector &proxyDatas) { @@ -267,7 +464,7 @@ void ProxyDataManager::OnAppInstall(const std::string &bundleName, int32_t user, }); } -void ProxyDataManager::OnAppUninstall(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId) +void ProxyDataManager::OnAppUpdate(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId) { std::vector proxyDatas; BundleInfo callerBundleInfo; @@ -276,9 +473,37 @@ void ProxyDataManager::OnAppUninstall(const std::string &bundleName, int32_t use callerBundleInfo.appIndex = index; callerBundleInfo.tokenId = tokenId; DataShareObserver::ChangeType type; + if (!GetCrossAppSharedConfig(bundleName, user, index, proxyDatas)) { + ZLOGE("GetCrossAppSharedConfig after install failed"); + return; + } + std::vector uris; + auto count = ProxyDataList::Query(tokenId, user, uris); + if (count <= 0) { + ZLOGI("bundle %{public}s has no proxyData", bundleName.c_str()); + } std::for_each(proxyDatas.begin(), proxyDatas.end(), [user, bundleName, callerBundleInfo, &type](const DataShareProxyData proxyData) { PublishedProxyData::Upsert(proxyData, callerBundleInfo, type, true); }); } + +void ProxyDataManager::OnAppUninstall(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId) +{ + DataShareProxyData proxyData; + BundleInfo callerBundleInfo; + callerBundleInfo.bundleName = bundleName; + callerBundleInfo.userId = user; + callerBundleInfo.appIndex = index; + callerBundleInfo.tokenId = tokenId; + DataShareObserver::ChangeType type; + std::vector uris; + auto count = ProxyDataList::Query(tokenId, user, uris); + if (count <= 0) { + ZLOGI("bundle %{public}s has no proxyData", bundleName.c_str()); + } + for (const auto &uri : uris) { + PublishedProxyData::Delete(uri, callerBundleInfo, proxyData, type, true); + } +} } // namespace OHOS::DataShare \ No newline at end of file diff --git a/services/distributeddataservice/service/data_share/common/proxy_data_manager.h b/services/distributeddataservice/service/data_share/common/proxy_data_manager.h index 3fe7db492..28ad1cf5b 100644 --- a/services/distributeddataservice/service/data_share/common/proxy_data_manager.h +++ b/services/distributeddataservice/service/data_share/common/proxy_data_manager.h @@ -21,21 +21,45 @@ #include "db_delegate.h" namespace OHOS::DataShare { +class ProxyDataListNode final : public VersionData { +public: + ProxyDataListNode(); + ProxyDataListNode(const std::vector &uris, const int32_t &userId, const uint32_t &tokenId) + : VersionData(0), uris(uris), userId(userId), tokenId(tokenId) {} + ~ProxyDataListNode() = default; + bool Marshal(json &node) const override; + bool Unmarshal(const json &node) override; + std::vector uris; + int32_t userId = Id::INVALID_USER; + uint32_t tokenId; +}; +class ProxyDataList final : public KvData { +public: + explicit ProxyDataList(const ProxyDataListNode &node); + ~ProxyDataList() = default; + static int32_t Query(const uint32_t &tokenId, const int32_t &userId, std::vector &proxyDataList); + static int32_t Delete(const std::vector uris, const uint32_t &tokenId, const int32_t &userId); + static int32_t Upsert(const std::vector &uris, const uint32_t &tokenId, const int32_t &userId); + static int32_t GetProxyDataCount(const uint32_t &tokenId, const int32_t &userId); + bool HasVersion() const override; + int GetVersion() const override; + std::string GetValue() const override; + +private: + ProxyDataListNode value; +}; + class ProxyDataNode final : public VersionData { public: ProxyDataNode(); - ProxyDataNode(const SerialDataShareProxyData proxyData, const std::string bundleName, - const int32_t userId, const int32_t &appIndex, const uint32_t tokenId) - : VersionData(0), proxyData(proxyData), bundleName(bundleName), - userId(userId), appIndex(appIndex), tokenId(tokenId) {} + ProxyDataNode(const SerialDataShareProxyData proxyData, const int32_t userId, const uint32_t tokenId) + : VersionData(0), proxyData(proxyData), userId(userId), tokenId(tokenId) {} ~ProxyDataNode() = default; bool Marshal(json &node) const override; bool Unmarshal(const json &node) override; SerialDataShareProxyData proxyData; - std::string bundleName; int32_t userId = Id::INVALID_USER; - int32_t appIndex = 0; uint32_t tokenId; }; @@ -64,6 +88,7 @@ class ProxyDataManager { public: static ProxyDataManager &GetInstance(); void OnAppInstall(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId); + void OnAppUpdate(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId); void OnAppUninstall(const std::string &bundleName, int32_t user, int32_t index, uint32_t tokenId); private: diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp index 4043d0511..b2889b29e 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp @@ -59,10 +59,6 @@ #include "xcollie.h" #include "log_debug.h" #include "parameters.h" -#include "dataproxy_handle_common.h" -#include "proxy_data_manager.h" -#include "datashare_observer.h" -#include "subscriber_managers/proxy_data_subscriber_manager.h" namespace OHOS::DataShare { using FeatureSystem = DistributedData::FeatureSystem; @@ -1017,6 +1013,11 @@ std::vector DataShareServiceImpl::PublishProxyData(const std::v datas[type].emplace_back(data); } } + std::vector uris; + std::for_each(keys.begin(), keys.end(), [&uris](const auto &key) { + uris.emplace_back(key.uri); + }); + ProxyDataList::Upsert(uris, callerBundleInfo.tokenId, callerBundleInfo.userId); ProxyDataSubscriberManager::GetInstance().Emit(keys, datas, callerBundleInfo.userId); return result; } @@ -1042,6 +1043,11 @@ std::vector DataShareServiceImpl::DeleteProxyData(const std::ve datas[type].emplace_back(oldProxyData); } } + std::vector lastDelUris; + std::for_each(keys.begin(), keys.end(), [&lastDelUris](const auto &key) { + lastDelUris.emplace_back(key.uri); + }); + ProxyDataList::Upsert(uris, callerBundleInfo.tokenId, callerBundleInfo.userId); ProxyDataSubscriberManager::GetInstance().Emit(keys, datas, callerBundleInfo.userId); return result; } 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 d39912924..0115b4d65 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.h +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.h @@ -41,6 +41,10 @@ #include "template_strategy.h" #include "uri_utils.h" #include "visibility.h" +#include "dataproxy_handle_common.h" +#include "proxy_data_manager.h" +#include "datashare_observer.h" +#include "subscriber_managers/proxy_data_subscriber_manager.h" namespace OHOS::DataShare { class DataShareServiceImpl : public DataShareServiceStub { diff --git a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp index a1548b4f6..a67131e32 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp @@ -462,6 +462,7 @@ void DataShareServiceStub::SetServiceReady() int32_t DataShareServiceStub::OnPublishProxyData(MessageParcel& data, MessageParcel& reply) { + ZLOGE("czydebug OnPublishProxyData"); std::vector proxyDatas; DataProxyConfig config; if (!ITypesUtil::Unmarshal(data, proxyDatas, config)) { diff --git a/services/distributeddataservice/service/data_share/sys_event_subscriber.cpp b/services/distributeddataservice/service/data_share/sys_event_subscriber.cpp index bade5009a..310a256dd 100644 --- a/services/distributeddataservice/service/data_share/sys_event_subscriber.cpp +++ b/services/distributeddataservice/service/data_share/sys_event_subscriber.cpp @@ -31,6 +31,8 @@ SysEventSubscriber::SysEventSubscriber(const EventFwk::CommonEventSubscribeInfo& installCallbacks_ = { { EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_ADDED, &SysEventSubscriber::OnAppInstall }, + { EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_CHANGED, + &SysEventSubscriber::OnAppUpdate }, { EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_REMOVED, &SysEventSubscriber::OnAppUninstall } }; @@ -74,6 +76,16 @@ void SysEventSubscriber::OnAppInstall(const std::string &bundleName, } } +void SysEventSubscriber::OnAppUpdate(const std::string &bundleName, + int32_t userId, int32_t appIndex, bool isCrossAppSharedConfig) +{ + ZLOGI("%{public}s updated, userId: %{public}d, appIndex: %{public}d", bundleName.c_str(), userId, appIndex); + uint32_t tokenId = Security::AccessToken::AccessTokenKit::GetHapTokenID(userId, bundleName, appIndex); + if (isCrossAppSharedConfig) { + ProxyDataManager::GetInstance().OnAppUpdate(bundleName, userId, appIndex, tokenId); + } +} + void SysEventSubscriber::OnAppUninstall(const std::string &bundleName, int32_t userId, int32_t appIndex, bool isCrossAppSharedConfig) { diff --git a/services/distributeddataservice/service/data_share/sys_event_subscriber.h b/services/distributeddataservice/service/data_share/sys_event_subscriber.h index 214f575d8..90a4d0a3f 100644 --- a/services/distributeddataservice/service/data_share/sys_event_subscriber.h +++ b/services/distributeddataservice/service/data_share/sys_event_subscriber.h @@ -31,6 +31,8 @@ public: void OnBMSReady(); void OnAppInstall(const std::string &bundleName, int32_t userId, int32_t appIndex, bool isCrossAppSharedConfig); + void OnAppUpdate(const std::string &bundleName, + int32_t userId, int32_t appIndex, bool isCrossAppSharedConfig); void OnAppUninstall(const std::string &bundleName, int32_t userId, int32_t appIndex, bool isCrossAppSharedConfig); -- Gitee