From aa5c95490df6cec90869fd32518982bbc1301a2c Mon Sep 17 00:00:00 2001 From: Mupceet Date: Wed, 20 Apr 2022 19:06:38 +0800 Subject: [PATCH 1/2] fix UITest connect aams file Signed-off-by: Mupceet --- services/aams/include/accessible_ability_connection.h | 11 +++++++++++ .../aams/src/accessible_ability_manager_service.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/services/aams/include/accessible_ability_connection.h b/services/aams/include/accessible_ability_connection.h index 460a31c1..7819401d 100644 --- a/services/aams/include/accessible_ability_connection.h +++ b/services/aams/include/accessible_ability_connection.h @@ -79,6 +79,17 @@ public: int32_t GetChannelId(); + void OnAbilityConnectDoneSync(const AppExecFwk::ElementName &element, const sptr &remoteObject, + int32_t resultCode) + { + InnerOnAbilityConnectDone(element, remoteObject, resultCode); + } + + void OnAbilityDisconnectDoneSync(const AppExecFwk::ElementName &element, int32_t resultCode) + { + InnerOnAbilityDisconnectDone(element, resultCode); + } + private: class AccessibleAbilityConnectionDeathRecipient final : public IRemoteObject::DeathRecipient { public: diff --git a/services/aams/src/accessible_ability_manager_service.cpp b/services/aams/src/accessible_ability_manager_service.cpp index 2806d177..dc2b4a32 100644 --- a/services/aams/src/accessible_ability_manager_service.cpp +++ b/services/aams/src/accessible_ability_manager_service.cpp @@ -1494,7 +1494,7 @@ void AccessibleAbilityManagerService::AddUITestClient(const sptr HILOG_ERROR("connection is null"); return; } - connection->OnAbilityConnectDone(*elementName, obj, 0); + connection->OnAbilityConnectDoneSync(*elementName, obj, 0); } bool AccessibleAbilityManagerService::DisableUITestAbility() @@ -1545,7 +1545,7 @@ void AccessibleAbilityManagerService::RemoveUITestClient(sptrRemoveInstalledAbility(UI_TEST_BUNDLE_NAME); - connection->OnAbilityDisconnectDone(connection->GetElementName(), 0); + connection->OnAbilityDisconnectDoneSync(connection->GetElementName(), 0); } int32_t AccessibleAbilityManagerService::GetActiveWindow() From 8b4917b4f0047893b350d77325d905ac22a61a7b Mon Sep 17 00:00:00 2001 From: Mupceet Date: Wed, 20 Apr 2022 19:51:43 +0800 Subject: [PATCH 2/2] fix test compile Signed-off-by: Mupceet --- .../src/mock_accessible_ability_connection.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/aams/test/mock/src/mock_accessible_ability_connection.cpp b/services/aams/test/mock/src/mock_accessible_ability_connection.cpp index 14726337..31e7b7de 100644 --- a/services/aams/test/mock/src/mock_accessible_ability_connection.cpp +++ b/services/aams/test/mock/src/mock_accessible_ability_connection.cpp @@ -276,5 +276,20 @@ void AccessibleAbilityConnection::OnAccessibilityEvent(AccessibilityEventInfo &e { (void)eventInfo; } + +void AccessibleAbilityConnection::InnerOnAbilityConnectDone(const AppExecFwk::ElementName &element, + const sptr &remoteObject, int32_t resultCode) +{ + (void)element; + (void)remoteObject; + (void)resultCode; +} + +void AccessibleAbilityConnection::InnerOnAbilityDisconnectDone(const AppExecFwk::ElementName &element, + int32_t resultCode) +{ + (void)element; + (void)resultCode; +} } // namespace Accessibility } // namespace OHOS \ No newline at end of file