Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5de5ac90 authored by Tony Wickham's avatar Tony Wickham
Browse files

Add IS_RUNNING_IN_TEST_HARNESS check for isTransientTaskbar

This avoids us trying to read FORCE_PERSISTENT_TASKBAR feature flag
which apparently crashes tests due to permission issues. Going forward,
when we support persistent taskbar better, we should update the tests
and this check as commented in the code.

Test: com.google.android.apps.nexuslauncher.TaplTestsNexus#testSearchNoInputs
Fixes: 261604544
Change-Id: I35c20825e8171766834f0f32be4f3818d02ab1df
parent 7286c5be
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -131,7 +131,10 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
     * Returns whether taskbar is transient.
     */
    public static boolean isTransientTaskbar(Context context) {
        if (FORCE_PERSISTENT_TASKBAR.get()) {
        // TODO(b/258604917): When running in test harness, use !sTransientTaskbarStatusForTests
        //  once tests are updated to expect new persistent behavior such as not allowing long press
        //  to stash.
        if (!Utilities.IS_RUNNING_IN_TEST_HARNESS && FORCE_PERSISTENT_TASKBAR.get()) {
            return false;
        }
        return getNavigationMode(context) == NavigationMode.NO_BUTTON