diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java index 6f124b8418..65614ba966 100644 --- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -1,5 +1,6 @@ package com.android.quickstep; +import static com.android.launcher3.testing.shared.TestProtocol.NPE_TRANSIENT_TASKBAR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.app.Activity; @@ -7,6 +8,7 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Rect; import android.os.Bundle; +import android.util.Log; import androidx.annotation.Nullable; @@ -184,9 +186,15 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { private void enableTransientTaskbar( TouchInteractionService.TISBinder tisBinder, boolean enable) { - // Allow null-pointer to catch illegal states. TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext(); - DisplayController.INSTANCE.get(context).enableTransientTaskbarForTests(enable); + if (context == null) { + if (TestProtocol.sDebugTracing) { + Log.d(NPE_TRANSIENT_TASKBAR, "enableTransientTaskbar: enable=" + enable, + new Exception()); + } + } else { + DisplayController.INSTANCE.get(context).enableTransientTaskbarForTests(enable); + } } /** diff --git a/src/com/android/launcher3/testing/shared/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java index 7586d0bc31..46e5891117 100644 --- a/src/com/android/launcher3/testing/shared/TestProtocol.java +++ b/src/com/android/launcher3/testing/shared/TestProtocol.java @@ -148,6 +148,7 @@ public final class TestProtocol { public static final String MISSING_PROMISE_ICON = "b/202985412"; public static final String TASKBAR_IN_APP_STATE = "b/227657604"; public static final String INCORRECT_INFO_UPDATED = "b/239465630"; + public static final String NPE_TRANSIENT_TASKBAR = "b/257549303"; public static final String REQUEST_EMULATE_DISPLAY = "emulate-display"; public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";