From 3c1def48102df0ca93009571a781daee9fd522df Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Tue, 10 Oct 2023 16:37:14 -0700 Subject: [PATCH] Moving verifyKeyguardInvisible() after other initializations verifyKeyguardInvisible can fail, and then tear down will be called, potentially accessing fields that currently get assigned after this call, causing crashes. Bug: 187761685 Test: presubmit Flag: N/A Change-Id: I865dfd70ce1821cee26800f57a13fb202626ea84 --- .../src/com/android/launcher3/ui/AbstractLauncherUiTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index fe5150901d..1f51d138ff 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -242,8 +242,6 @@ public abstract class AbstractLauncherUiTest { public void setUp() throws Exception { mLauncher.onTestStart(); - verifyKeyguardInvisible(); - final String launcherPackageName = mDevice.getLauncherPackageName(); try { final Context context = InstrumentationRegistry.getContext(); @@ -273,6 +271,8 @@ public abstract class AbstractLauncherUiTest { } } } + + verifyKeyguardInvisible(); } private static void verifyKeyguardInvisible() {