From 0d77653816ae07a43910f476ede29236952c8c82 Mon Sep 17 00:00:00 2001 From: xiehd Date: Sat, 26 Jul 2025 11:11:43 +0800 Subject: [PATCH] rever onTimeout Signed-off-by: xiehd --- .../src/ability_connect_manager.cpp | 6 +-- .../ability_connect_manager_fourth_test.cpp | 48 ------------------- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp index 301f76e21dc..43d3c1db85f 100644 --- a/services/abilitymgr/src/ability_connect_manager.cpp +++ b/services/abilitymgr/src/ability_connect_manager.cpp @@ -2412,11 +2412,7 @@ void AbilityConnectManager::OnTimeOut(uint32_t msgId, int64_t abilityRecordId, b auto abilityRecord = GetExtensionByIdFromServiceMap(abilityRecordId); if (abilityRecord == nullptr) { TAG_LOGE(AAFwkTag::SERVICE_EXT, "null abilityRecord"); - abilityRecord = GetExtensionByIdFromTerminatingMap(abilityRecordId); - if (!IsUIExtensionAbility(abilityRecord)) { - TAG_LOGW(AAFwkTag::UI_EXT, "null terminatingRecord or not uea"); - return; - } + return; } PrintTimeOutLog(abilityRecord, msgId, isHalf); if (isHalf) { diff --git a/test/unittest/ability_connect_manager_fourth_test/ability_connect_manager_fourth_test.cpp b/test/unittest/ability_connect_manager_fourth_test/ability_connect_manager_fourth_test.cpp index 8c7ca34cb02..65f821e30a8 100644 --- a/test/unittest/ability_connect_manager_fourth_test/ability_connect_manager_fourth_test.cpp +++ b/test/unittest/ability_connect_manager_fourth_test/ability_connect_manager_fourth_test.cpp @@ -1051,53 +1051,5 @@ HWTEST_F(AbilityConnectManagerFourthTest, AAFWK_Kit_ResumeExtensionAbilityLocked EXPECT_EQ(result3, OHOS::ERR_OK); } -/* - * Feature: AbilityConnectManager - * Function: OnTimeOut - * SubFunction: OnTimeOut - * FunctionPoints: NA - * EnvConditions: NA - * CaseDescription: Verify AbilityConnectManager OnTimeOut - */ -HWTEST_F(AbilityConnectManagerFourthTest, AAFwk_AbilityMS_OnTimeOut_002, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "AAFwk_AbilityMS_OnTimeOut_002 start"); - std::shared_ptr connectManager = std::make_shared(0); - AbilityRequest abilityRequest; - abilityRequest.appInfo.bundleName = "com.example.unittest"; - abilityRequest.abilityInfo.name = "MainAbility"; - abilityRequest.abilityInfo.type = AbilityType::PAGE; - abilityRequest.abilityInfo.extensionAbilityType = AppExecFwk::ExtensionAbilityType::SHARE; - std::shared_ptr abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest); - int64_t abilityRecordId = 1; - uint32_t msgId = 111; - connectManager->terminatingExtensionList_.push_back(abilityRecord); - connectManager->OnTimeOut(msgId, abilityRecordId); - abilityRecordId = abilityRecord->GetAbilityRecordId(); - connectManager->OnTimeOut(msgId, abilityRecordId); - connectManager->terminatingExtensionList_.clear(); - TAG_LOGI(AAFwkTag::TEST, "AAFwk_AbilityMS_OnTimeOut_002 end"); -} - -/* - * Feature: AbilityConnectManager - * Function: OnTimeOut - * SubFunction: OnTimeOut - * FunctionPoints: NA - * EnvConditions: NA - * CaseDescription: Verify AbilityConnectManager OnTimeOut - */ -HWTEST_F(AbilityConnectManagerFourthTest, AAFwk_AbilityMS_OnTimeOut_003, TestSize.Level1) -{ - TAG_LOGI(AAFwkTag::TEST, "AAFwk_AbilityMS_OnTimeOut_003 start"); - std::shared_ptr connectManager = std::make_shared(0); - std::shared_ptr abilityRecord = serviceRecord_; - uint32_t msgId = 111; - connectManager->terminatingExtensionList_.push_back(abilityRecord); - int64_t abilityRecordId = abilityRecord->GetAbilityRecordId(); - connectManager->OnTimeOut(msgId, abilityRecordId); - connectManager->terminatingExtensionList_.clear(); - TAG_LOGI(AAFwkTag::TEST, "AAFwk_AbilityMS_OnTimeOut_003 end"); -} } // namespace AAFwk } // namespace OHOS -- Gitee