From 9f86b17c2cdcd6f8dce4ed3c00e221c5e578fa5b Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Sat, 24 Feb 2024 21:24:26 -0800 Subject: [PATCH] Fix bug where TAPL test is checking test's ApplicationInfo Bug: 326118348 Test: This is the test Flag: NONE Change-Id: I7519727366b1ad03a50da07d6d331135fdcb89a4 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 389b57fa22..1dc4f9696c 100644 --- a/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/multivalentTests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -1207,7 +1207,8 @@ public final class LauncherInstrumentation { waitForNavigationUiObject("back").click(); } if (launcherVisible) { - if (getContext().getApplicationInfo().isOnBackInvokedCallbackEnabled()) { + if (InstrumentationRegistry.getTargetContext().getApplicationInfo() + .isOnBackInvokedCallbackEnabled()) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_ON_BACK_INVOKED); } else { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_KEY_BACK_DOWN);