mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-27 09:01:45 +00:00
只有一个extension的时候,直接拉起
Signed-off-by: wangjiaqiang <wangjiaqiang11@huawei.com>
This commit is contained in:
parent
1ddf7c5d63
commit
f755d664a7
@ -66,12 +66,18 @@ int DataProviderConfig::GetFromProxyData()
|
||||
return errCode;
|
||||
}
|
||||
providerInfo_.singleton = bundleInfo.singleton;
|
||||
int datashareExtensionCount = 0;
|
||||
for (auto &item : bundleInfo.extensionInfos) {
|
||||
if (item.type != AppExecFwk::ExtensionAbilityType::DATASHARE) {
|
||||
continue;
|
||||
}
|
||||
providerInfo_.hasExtension = true;
|
||||
break;
|
||||
++datashareExtensionCount;
|
||||
providerInfo_.extensionUri = item.uri;
|
||||
if (datashareExtensionCount > 1) {
|
||||
providerInfo_.extensionUri = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (auto &hapModuleInfo : bundleInfo.hapModuleInfos) {
|
||||
auto &proxyDatas = hapModuleInfo.proxyDatas;
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
std::string writePermission;
|
||||
std::string type = "rdb";
|
||||
std::string backup;
|
||||
std::string extensionUri;
|
||||
bool singleton = false;
|
||||
bool hasExtension = false;
|
||||
bool allowEmptyPermission = false;
|
||||
|
@ -1043,7 +1043,11 @@ std::pair<int32_t, int32_t> DataShareServiceImpl::ExecuteEx(const std::string &u
|
||||
return std::make_pair(ERROR_PERMISSION_DENIED, 0);
|
||||
}
|
||||
DataShareDbConfig dbConfig;
|
||||
DataShareDbConfig::DbConfig config {providerInfo.uri, extUri, providerInfo.bundleName,
|
||||
std::string extensionUri = extUri;
|
||||
if (extensionUri.empty()) {
|
||||
extensionUri = providerInfo.extensionUri;
|
||||
}
|
||||
DataShareDbConfig::DbConfig config {providerInfo.uri, extensionUri, providerInfo.bundleName,
|
||||
providerInfo.storeName, providerInfo.backup,
|
||||
providerInfo.singleton ? 0 : providerInfo.currentUserId, providerInfo.hasExtension};
|
||||
auto [code, metaData, dbDelegate] = dbConfig.GetDbConfig(config);
|
||||
|
Loading…
Reference in New Issue
Block a user