Tearing down the test safely.
If the test fails to initialize properly, tearDown is still called,
and we may have null Launcher activity.
We want to safely skip using that activity to avoid a NullPointerException
that would hide the original error message.
Bug: 303070230
Test: presubmit
Flag: N/A
Change-Id: I3bb07fa55e5793c73caaaeda57168aa11c85893e
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index f383949..3039261 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -83,6 +83,7 @@
@After
public void tearDown() {
executeOnLauncher(launcher -> {
+ if (launcher == null) return;
RecentsView recentsView = launcher.getOverviewPanel();
recentsView.getPagedViewOrientedState().forceAllowRotationForTesting(false);
});