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
This commit is contained in:
Vadim Tryshev
2023-10-10 16:37:14 -07:00
parent 9f34a29d0e
commit 3c1def4810
@@ -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() {