修改校验互联面板应用的方式回合

Signed-off-by: du-zhihai <duzhihai@huawei.com>
Change-Id: Ic9787aeaaa759b2e336512bb389700ad28376e9a
This commit is contained in:
du-zhihai 2022-11-02 10:26:13 +08:00
parent 40d10e419f
commit 862a86d666
5 changed files with 6 additions and 82 deletions

View File

@ -66,7 +66,6 @@
],
"service_group": [
"//foundation/ability/dmsfwk/etc/init:etc",
"//foundation/ability/dmsfwk/etc/param:param_files",
"//foundation/ability/dmsfwk/etc/profile:distributedsched_trust",
"//foundation/ability/dmsfwk/sa_profile:dms_sa_profile",
"//foundation/ability/dmsfwk/services/base:dmsbaseinner",

View File

@ -1,38 +0,0 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init/services/etc/param/param_fixer.gni")
import("//build/ohos.gni")
#################################################################################
group("param_files") {
deps = [
":dms.para",
":dms.para.dac",
]
}
ohos_prebuilt_para("dms.para") {
source = "dms.para"
module_install_dir = "etc/param"
subsystem_name = "ability"
part_name = "dmsfwk"
}
ohos_prebuilt_para("dms.para.dac") {
source = "dms.para.dac"
module_install_dir = "etc/param"
subsystem_name = "ability"
part_name = "dmsfwk"
}

View File

@ -1,14 +0,0 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
const.distributedsched.panelname="ohos.samples.eTSServiceExtAbility_ServiceExtAbility"

View File

@ -1,14 +0,0 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
const.distributedsched. = dms:dms:0775

View File

@ -80,9 +80,7 @@ const std::string UID_KEY = "uid";
const std::string COMPONENT_TYPE_KEY = "componentType";
const std::string DEVICE_TYPE_KEY = "deviceType";
const std::string CHANGE_TYPE_KEY = "changeType";
const std::string PANEL_NAME_KEY = "const.distributedsched.panelname";
const std::string DEFAULT_PANEL_NAME_VALUE = "";
constexpr int32_t MAX_SPLIT_VARS = 2;
const std::string DMS_HIPLAY_ACTION = "ohos.ability.action.deviceSelect";
constexpr int32_t BIND_CONNECT_RETRY_TIMES = 3;
constexpr int32_t BIND_CONNECT_TIMEOUT = 500; // 500ms
constexpr int32_t MAX_DISTRIBUTED_CONNECT_NUM = 600;
@ -2019,19 +2017,12 @@ int32_t DistributedSchedService::ConnectAbility(const sptr<DmsNotifier>& dmsNoti
const std::shared_ptr<ContinuationExtraParams>& continuationExtraParams)
{
Want want;
// get bundleName and abilityName from parameter
std::string panelName = system::GetParameter(PANEL_NAME_KEY, DEFAULT_PANEL_NAME_VALUE);
if (panelName.empty()) {
HILOGE("get panelName from parameter failed");
return PANEL_NAME_NOT_CONFIGURED;
want.SetAction(DMS_HIPLAY_ACTION);
AppExecFwk::ExtensionAbilityInfo extensionAbility;
if (!BundleManagerInternal::QueryExtensionAbilityInfo(want, extensionAbility)) {
HILOGE("QueryExtensionAbilityInfo failed");
return CONNECT_ABILITY_FAILED;
}
std::vector<std::string> nameVector;
SplitStr(panelName, "_", nameVector);
if (nameVector.size() != MAX_SPLIT_VARS) {
HILOGE("parse panelName failed");
return PANEL_NAME_NOT_CONFIGURED;
}
want.SetElementName(nameVector[0], nameVector[1]);
if (connect_ == nullptr) {
connect_ = new AppConnectionStub(dmsNotifier, token, continuationExtraParams);
}