Fix bug where TAPL test is checking test's ApplicationInfo

Bug: 326118348
Test: This is the test
Flag: NONE
Change-Id: I7519727366b1ad03a50da07d6d331135fdcb89a4
This commit is contained in:
Fengjiang Li
2024-02-24 21:24:26 -08:00
parent 6e3541e703
commit 9f86b17c2c
@@ -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);