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

Commit 182d1e93 authored by Jon Miranda's avatar Jon Miranda
Browse files

Check NPE and log error condition for enableTransientTaskbar in test harness.

Fixes: 259337908
Bug: 257549303
Test: TaplTestsTaskbar
Change-Id: Ifa929dca18437ae101cf3290feda4209790604d2
parent b6acf00e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
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,10 +186,16 @@ 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();
        if (context == null) {
            if (TestProtocol.sDebugTracing) {
                Log.d(NPE_TRANSIENT_TASKBAR, "enableTransientTaskbar: enable=" + enable,
                        new Exception());
            }
        } else {
            DisplayController.INSTANCE.get(context).enableTransientTaskbarForTests(enable);
        }
    }

    /**
     * Runs the given command on the UI thread, after ensuring we are connected to
+1 −0
Original line number Diff line number Diff line
@@ -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";