From 6ae2dcaf134a127fc3e295ca25f0e4e1e9847c10 Mon Sep 17 00:00:00 2001 From: liuhongjie Date: Tue, 16 Apr 2024 14:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8E=A5=E7=BB=AD=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=90=8E=E5=BA=94=E7=94=A8=E8=83=BD=E5=A4=9F=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuhongjie --- services/dtbschedmgr/BUILD.gn | 3 + .../include/continue_scene_session_handler.h | 40 +++++++ .../dtbschedmgr/include/distributed_radar.h | 2 +- .../include/distributed_sched_service.h | 1 + .../src/bundle/bundle_manager_internal.cpp | 2 +- .../src/continue_scene_session_handler.cpp | 95 +++++++++++++++ .../src/distributed_sched_service.cpp | 48 +++++++- services/dtbschedmgr/test/BUILD.gn | 4 + .../continue_scene_session_handler_test.cpp | 108 ++++++++++++++++++ .../continue_scene_session_handler_test.h | 34 ++++++ .../distributed_sched_service_second_test.cpp | 13 +++ 11 files changed, 347 insertions(+), 3 deletions(-) create mode 100644 services/dtbschedmgr/include/continue_scene_session_handler.h create mode 100644 services/dtbschedmgr/src/continue_scene_session_handler.cpp create mode 100644 services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.cpp create mode 100644 services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.h diff --git a/services/dtbschedmgr/BUILD.gn b/services/dtbschedmgr/BUILD.gn index fe09aefc..29c1fff3 100644 --- a/services/dtbschedmgr/BUILD.gn +++ b/services/dtbschedmgr/BUILD.gn @@ -95,6 +95,7 @@ ohos_shared_library("distributedschedsvr") { "src/continue/state/source_state/dsched_continue_source_end_state.cpp", "src/continue/state/source_state/dsched_continue_source_start_state.cpp", "src/continue/state/source_state/dsched_continue_source_wait_end_state.cpp", + "src/continue_scene_session_handler.cpp", "src/datashare_manager.cpp", "src/deviceManager/dms_device_info.cpp", "src/dfx/dms_continue_time_dumper.cpp", @@ -171,6 +172,8 @@ ohos_shared_library("distributedschedsvr") { "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "window_manager:scene_session", + "window_manager:session_manager_lite", ] if (os_account_part) { external_deps += [ "os_account:os_account_innerkits" ] diff --git a/services/dtbschedmgr/include/continue_scene_session_handler.h b/services/dtbschedmgr/include/continue_scene_session_handler.h new file mode 100644 index 00000000..9ffed208 --- /dev/null +++ b/services/dtbschedmgr/include/continue_scene_session_handler.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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. + */ + +#ifndef OHOS_DISTRIBUTED_CONTINUE_SCENE_SESSION_HANDLER_H +#define OHOS_DISTRIBUTED_CONTINUE_SCENE_SESSION_HANDLER_H + +#include + +#include "single_instance.h" + +namespace OHOS { +namespace DistributedSchedule { +class ContinueSceneSessionHandler { +public: + DECLARE_SINGLE_INSTANCE_BASE(ContinueSceneSessionHandler); +public: + ContinueSceneSessionHandler() = default; + virtual ~ContinueSceneSessionHandler() = default; + void UpdateContinueSessionId(const std::string& bundleName, const std::string& abilityName); + std::string GetContinueSessionId() const; + void ClearContinueSessionId(); + int32_t GetPersistentId(int32_t& persistentId); +private: + std::string continueSessionId_; +}; +} // namespace DistributedSchedule +} // namespace OHOS +#endif // OHOS_DISTRIBUTED_CONTINUE_SCENE_SESSION_HANDLER_H \ No newline at end of file diff --git a/services/dtbschedmgr/include/distributed_radar.h b/services/dtbschedmgr/include/distributed_radar.h index 4a6f8512..86376a82 100644 --- a/services/dtbschedmgr/include/distributed_radar.h +++ b/services/dtbschedmgr/include/distributed_radar.h @@ -125,7 +125,7 @@ enum class RecvUnfocused : int32_t { enum class ClickIcon : int32_t { DMS_CONTINUE = 4, DMS_STARTABILITY = 5, - DMS_RECV_OVER = 8, + DMS_RECV_OVER = 10, }; enum class SaveData : int32_t { diff --git a/services/dtbschedmgr/include/distributed_sched_service.h b/services/dtbschedmgr/include/distributed_sched_service.h index 1c35e5ad..694b2165 100644 --- a/services/dtbschedmgr/include/distributed_sched_service.h +++ b/services/dtbschedmgr/include/distributed_sched_service.h @@ -255,6 +255,7 @@ private: void SetCleanMissionFlag(const OHOS::AAFwk::Want& want, int32_t missionId); void RemoveConnectAbilityInfo(const std::string& deviceId); ErrCode QueryOsAccount(int32_t& activeAccountId); + int32_t QuickStartAbility(const std::string& bundleName); std::shared_ptr dschedContinuation_; std::map, std::list> distributedConnectAbilityMap_; diff --git a/services/dtbschedmgr/src/bundle/bundle_manager_internal.cpp b/services/dtbschedmgr/src/bundle/bundle_manager_internal.cpp index a62c8f07..e0f749bd 100644 --- a/services/dtbschedmgr/src/bundle/bundle_manager_internal.cpp +++ b/services/dtbschedmgr/src/bundle/bundle_manager_internal.cpp @@ -180,7 +180,7 @@ int32_t BundleManagerInternal::GetLocalBundleInfo(const std::string& bundleName, if (err != ERR_OK) { return err; } - if (!bms->GetBundleInfo(bundleName, AppExecFwk::BundleFlag::GET_BUNDLE_DEFAULT, + if (!bms->GetBundleInfo(bundleName, AppExecFwk::BundleFlag::GET_BUNDLE_WITH_ABILITIES, localBundleInfo, activeAccountId)) { HILOGE("get local bundle info failed"); return INVALID_PARAMETERS_ERR; diff --git a/services/dtbschedmgr/src/continue_scene_session_handler.cpp b/services/dtbschedmgr/src/continue_scene_session_handler.cpp new file mode 100644 index 00000000..0ca853ff --- /dev/null +++ b/services/dtbschedmgr/src/continue_scene_session_handler.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 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. + */ + +#include "continue_scene_session_handler.h" + +#include +#include + +#include "dtbschedmgr_log.h" +#include "scene_board_judgement.h" +#include "session_manager_lite.h" + +namespace OHOS { +namespace DistributedSchedule { +namespace { +const std::string TAG = "ContinueSceneSessionHandler"; +constexpr int32_t RETRY_TIMES = 2; +constexpr int32_t SLEEP_TIME = 50; +} + +IMPLEMENT_SINGLE_INSTANCE(ContinueSceneSessionHandler); + +using OHOS::Rosen::SessionManagerLite; +using OHOS::Rosen::WSError; + +void ContinueSceneSessionHandler::UpdateContinueSessionId(const std::string& bundleName, const std::string& abilityName) +{ + HILOGD("Update continueSessionId, bundleName: %{public}s, abilityName: %{public}s", + bundleName.c_str(), abilityName.c_str()); + auto now = std::chrono::system_clock::now(); + int64_t timeStamp = std::chrono::duration_cast(now.time_since_epoch()).count(); + std::size_t hash = std::hash()(bundleName + abilityName + std::to_string(timeStamp)); + continueSessionId_ = std::to_string(hash); +} + +std::string ContinueSceneSessionHandler::GetContinueSessionId() const +{ + return continueSessionId_; +} + +void ContinueSceneSessionHandler::ClearContinueSessionId() +{ + HILOGI("%{public}s called", __func__); + continueSessionId_.clear(); +} + +int32_t ContinueSceneSessionHandler::GetPersistentId(int32_t& persistentId) +{ + HILOGI("%{public}s called", __func__); + if (continueSessionId_.empty()) { + HILOGE("continueSessionId is empty."); + return INVALID_PARAMETERS_ERR; + } + if (!Rosen::SceneBoardJudgement::IsSceneBoardEnabled()) { + HILOGE("sceneBoard not available."); + return INVALID_PARAMETERS_ERR; + } + + auto sceneSessionManager = SessionManagerLite::GetInstance().GetSceneSessionManagerLiteProxy(); + if (!sceneSessionManager) { + HILOGE("proxy is nullptr."); + return INVALID_PARAMETERS_ERR; + } + + int32_t retryTimeout = RETRY_TIMES; + AAFwk::MissionInfo missionInfo; + do { + auto err = sceneSessionManager->GetSessionInfoByContinueSessionId(continueSessionId_, missionInfo); + if (err == WSError::WS_OK) { + continueSessionId_.clear(); + persistentId = missionInfo.id; + return ERR_OK; + } + HILOGE("Get sessionInfo failed, continueSessionId: %{public}s, errorCode: %{public}d", + continueSessionId_.c_str(), err); + std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); + } while (--retryTimeout >= 0); + + continueSessionId_.clear(); + return INVALID_PARAMETERS_ERR; +} +} // namespace DistributedSchedule +} // namespace OHOS \ No newline at end of file diff --git a/services/dtbschedmgr/src/distributed_sched_service.cpp b/services/dtbschedmgr/src/distributed_sched_service.cpp index 7cc10162..d7ba96f0 100644 --- a/services/dtbschedmgr/src/distributed_sched_service.cpp +++ b/services/dtbschedmgr/src/distributed_sched_service.cpp @@ -42,6 +42,7 @@ #include "adapter/dnetwork_adapter.h" #include "bundle/bundle_manager_internal.h" #include "connect_death_recipient.h" +#include "continue_scene_session_handler.h" #include "dfx/dms_continue_time_dumper.h" #include "distributed_radar.h" #include "distributed_sched_adapter.h" @@ -55,6 +56,7 @@ #include "dtbschedmgr_device_info_storage.h" #include "dtbschedmgr_log.h" #include "parcel_helper.h" +#include "scene_board_judgement.h" #include "switch_status_dependency.h" #ifdef SUPPORT_COMMON_EVENT_SERVICE #include "common_event_listener.h" @@ -100,6 +102,8 @@ const std::string SUPPORT_CONTINUE_SOURCE_EXIT_KEY = "ohos.extra.param.key.suppo const std::string SUPPORT_CONTINUE_MODULE_NAME_UPDATE_KEY = "ohos.extra.param.key.supportContinueModuleNameUpdate"; const std::string DSCHED_EVENT_KEY = "IDSchedEventListener"; const std::string DMSDURATION_SAVETIME = "ohos.dschedule.SaveDataTime"; +const std::string DMS_CONTINUE_SESSION_ID = "ohos.dms.continueSessionId"; +const std::string DMS_PERSISTENT_ID = "ohos.dms.persistentId"; constexpr int32_t DEFAULT_DMS_MISSION_ID = -1; constexpr int32_t DEFAULT_DMS_CONNECT_TOKEN = -1; constexpr int32_t BIND_CONNECT_RETRY_TIMES = 3; @@ -329,7 +333,15 @@ int32_t DistributedSchedService::StartAbilityFromRemote(const OHOS::AAFwk::Want& HILOGE("CheckTargetPermission failed!!"); return result; } - return StartAbility(want, requestCode); + + int32_t persistentId; + AAFwk::Want newWant = want; + int32_t err = ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId); + if (err == ERR_OK) { + HILOGI("get persistentId success, persistentId: %{public}d", persistentId); + newWant.SetParam(DMS_PERSISTENT_ID, persistentId); + } + return StartAbility(newWant, requestCode); } int32_t DistributedSchedService::SendResultFromRemote(OHOS::AAFwk::Want& want, int32_t requestCode, @@ -535,6 +547,8 @@ int32_t DistributedSchedService::ContinueRemoteMission(const std::string& srcDev DmsContinueTime::GetInstance().SetDurationBegin(DMSDURATION_DSTTOSRCRPCTIME, begin); DmsContinueTime::GetInstance().SetDurationBegin(DMSDURATION_TOTALTIME, begin); } + + QuickStartAbility(bundleName); sptr remoteDms = GetRemoteDms(srcDeviceId); if (remoteDms == nullptr) { HILOGE("get remote dms null!"); @@ -542,6 +556,7 @@ int32_t DistributedSchedService::ContinueRemoteMission(const std::string& srcDev HILOGE("continuation object null!"); return INVALID_PARAMETERS_ERR; } + ContinueSceneSessionHandler::GetInstance().ClearContinueSessionId(); int32_t dSchedEventresult = dschedContinuation_->NotifyDSchedEventResult(DSCHED_EVENT_KEY, INVALID_REMOTE_PARAMETERS_ERR); HILOGD("NotifyDSchedEventResult result:%{public}d", dSchedEventresult); @@ -559,12 +574,43 @@ int32_t DistributedSchedService::ContinueRemoteMission(const std::string& srcDev HILOGE("continuation object null!"); return INVALID_PARAMETERS_ERR; } + ContinueSceneSessionHandler::GetInstance().ClearContinueSessionId(); int32_t dSchedEventresult = dschedContinuation_->NotifyDSchedEventResult(DSCHED_EVENT_KEY, result); HILOGD("NotifyDSchedEventResult result:%{public}d", dSchedEventresult); } return result; } +int32_t DistributedSchedService::QuickStartAbility(const std::string& bundleName) +{ + HILOGI("%{public}s called", __func__); + if (!Rosen::SceneBoardJudgement::IsSceneBoardEnabled()) { + HILOGE("sceneBoard not available."); + return INVALID_PARAMETERS_ERR; + } + + BundleInfo localBundleInfo; + if (BundleManagerInternal::GetLocalBundleInfo(bundleName, localBundleInfo) != ERR_OK) { + HILOGE("get local bundle info failed."); + return INVALID_PARAMETERS_ERR; + } + if (localBundleInfo.abilityInfos.empty() || localBundleInfo.abilityInfos.size() > 1) { + HILOGE("quick start is not supported, abilityInfos size: %{public}d", + static_cast(localBundleInfo.abilityInfos.size())); + return INVALID_PARAMETERS_ERR; + } + + auto abilityInfo = localBundleInfo.abilityInfos.front(); + ContinueSceneSessionHandler::GetInstance().UpdateContinueSessionId(bundleName, abilityInfo.name); + std::string continueSessionId = ContinueSceneSessionHandler::GetInstance().GetContinueSessionId(); + HILOGI("continueSessionId is %{public}s", continueSessionId.c_str()); + + AAFwk::Want want; + want.SetElementName(bundleName, abilityInfo.name); + want.SetParam(DMS_CONTINUE_SESSION_ID, continueSessionId); + return StartAbility(want, DEFAULT_REQUEST_CODE); +} + int32_t DistributedSchedService::ContinueMission(const std::string& srcDeviceId, const std::string& dstDeviceId, int32_t missionId, const sptr& callback, const OHOS::AAFwk::WantParams& wantParams) { diff --git a/services/dtbschedmgr/test/BUILD.gn b/services/dtbschedmgr/test/BUILD.gn index 3aeaaa01..035ba8dc 100644 --- a/services/dtbschedmgr/test/BUILD.gn +++ b/services/dtbschedmgr/test/BUILD.gn @@ -65,6 +65,8 @@ dsched_external_deps = [ "kv_store:distributeddata_inner", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "window_manager:scene_session", + "window_manager:session_manager_lite", ] if (os_account_part) { dsched_external_deps += [ "os_account:os_account_innerkits" ] @@ -112,6 +114,7 @@ dtbschedmgr_sources = [ "${distributed_service}/dtbschedmgr/src/bundle/bundle_manager_callback_stub.cpp", "${distributed_service}/dtbschedmgr/src/bundle/bundle_manager_internal.cpp", "${distributed_service}/dtbschedmgr/src/connect_death_recipient.cpp", + "${distributed_service}/dtbschedmgr/src/continue_scene_session_handler.cpp", "${distributed_service}/dtbschedmgr/src/datashare_manager.cpp", "${distributed_service}/dtbschedmgr/src/deviceManager/dms_device_info.cpp", "${distributed_service}/dtbschedmgr/src/dfx/dms_continue_time_dumper.cpp", @@ -197,6 +200,7 @@ ohos_unittest("distributedschedsvrtest") { ] sources = [ + "unittest/continue_scene_session_handler_test.cpp", "unittest/distributed_radar_test.cpp", "unittest/distributed_sched_adapter_test.cpp", "unittest/distributed_sched_dumper_test.cpp", diff --git a/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.cpp b/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.cpp new file mode 100644 index 00000000..1b5536dd --- /dev/null +++ b/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 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. + */ + +#include "continue_scene_session_handler_test.h" + +#include "dtbschedmgr_log.h" +#include "test_log.h" + +using namespace testing; +using namespace testing::ext; + +namespace OHOS { +namespace DistributedSchedule { + +void ContinueSceneSessionHandlerTest::SetUpTestCase() +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest::SetUpTestCase" << std::endl; +} + +void ContinueSceneSessionHandlerTest::TearDownTestCase() +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest::TearDownTestCase" << std::endl; +} + +void ContinueSceneSessionHandlerTest::TearDown() +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest::TearDown" << std::endl; +} + +void ContinueSceneSessionHandlerTest::SetUp() +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest::SetUp" << std::endl; +} + +/** + * @tc.name: UpdateContinueSessionId_001 + * @tc.desc: generated continueSessionId by bundleName and abilityName + * @tc.type: FUNC + * @tc.require: SR20240116512594 + */ +HWTEST_F(ContinueSceneSessionHandlerTest, UpdateContinueSessionId_001, TestSize.Level3) +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest UpdateContinueSessionId_001 begin" << std::endl; + std::string bundleName = "ohos.dms.bundleName_001"; + std::string abilityName = "ohos.dms.abilityName_001"; + ContinueSceneSessionHandler::GetInstance().UpdateContinueSessionId(bundleName, abilityName); + std::string continueSessionId = ContinueSceneSessionHandler::GetInstance().GetContinueSessionId(); + EXPECT_FALSE(continueSessionId.empty()); + DTEST_LOG << "ContinueSceneSessionHandlerTest UpdateContinueSessionId_001 end" << std::endl; +} + +/** + * @tc.name: GetContinueSessionId_001 + * @tc.desc: get continueSessionId test + * @tc.type: FUNC + * @tc.require: SR20240116512594 + */ + HWTEST_F(ContinueSceneSessionHandlerTest, GetContinueSessionId_001, TestSize.Level3) +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest GetContinueSessionId_001 begin" << std::endl; + std::string continueSessionId = ContinueSceneSessionHandler::GetInstance().GetContinueSessionId(); + EXPECT_FALSE(continueSessionId.empty()); + DTEST_LOG << "ContinueSceneSessionHandlerTest GetContinueSessionId_001 end" << std::endl; +} + +/** + * @tc.name: GetPersistentId_001 + * @tc.desc: get persistentId by continueSessionId + * @tc.type: FUNC + * @tc.require: SR20240116512594 + */ +HWTEST_F(ContinueSceneSessionHandlerTest, GetPersistentId_001, TestSize.Level3) +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest GetPersistentId_001 begin" << std::endl; + int32_t persistentId; + int32_t err = ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId); + EXPECT_EQ(static_cast(INVALID_PARAMETERS_ERR), err); + DTEST_LOG << "ContinueSceneSessionHandlerTest GetPersistentId_001 end" << std::endl; +} + +/** + * @tc.name: ClearContinueSessionId_001 + * @tc.desc: clear continueSessionId test + * @tc.type: FUNC + * @tc.require: SR20240116512594 + */ +HWTEST_F(ContinueSceneSessionHandlerTest, ClearContinueSessionId_001, TestSize.Level3) +{ + DTEST_LOG << "ContinueSceneSessionHandlerTest ClearContinueSessionId_001 begin" << std::endl; + ContinueSceneSessionHandler::GetInstance().ClearContinueSessionId(); + std::string continueSessionId = ContinueSceneSessionHandler::GetInstance().GetContinueSessionId(); + EXPECT_TRUE(continueSessionId.empty()); + DTEST_LOG << "ContinueSceneSessionHandlerTest ClearContinueSessionId_001 end" << std::endl; +} +} +} \ No newline at end of file diff --git a/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.h b/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.h new file mode 100644 index 00000000..453579f9 --- /dev/null +++ b/services/dtbschedmgr/test/unittest/continue_scene_session_handler_test.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 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. + */ + +#ifndef ABILITY_CONTINUE_SESSION_TEST_H +#define ABILITY_CONTINUE_SESSION_TEST_H + +#include + +#include "continue_scene_session_handler.h" + +namespace OHOS { +namespace DistributedSchedule { +class ContinueSceneSessionHandlerTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; +} // namespace DistributedSchedule +} // namespace OHOS +#endif // ABILITY_CONTINUE_SESSION_TEST_H \ No newline at end of file diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp b/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp index abc25d3d..1185ee4d 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp +++ b/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp @@ -1430,5 +1430,18 @@ HWTEST_F(DistributedSchedServiceSecondTest, ContinueMissionBundleName_002, TestS EXPECT_EQ(static_cast(OPERATION_DEVICE_NOT_INITIATOR_OR_TARGET), result); DTEST_LOG << "DSchedContinuationTest ContinueMissionBundleName_002 end" << std::endl; } + +/** + * @tc.name: QuickStartAbility_001 + * @tc.desc: quick start ability test + * @tc.type: FUNC + */ +HWTEST_F(DistributedSchedServiceSecondTest, QuickStartAbility_001, TestSize.Level3) +{ + DTEST_LOG << "DSchedContinuationTest QuickStartAbility_001 start" << std::endl; + auto ret = DistributedSchedService::GetInstance().QuickStartAbility("bundleName"); + EXPECT_EQ(static_cast(INVALID_PARAMETERS_ERR), ret); + DTEST_LOG << "DSchedContinuationTest QuickStartAbility_001 end" << std::endl; +} } } \ No newline at end of file