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

Commit 0a051183 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Tapl: also logging contexts" into ub-launcher3-master

parents a851c9f3 77ca70fe
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -201,13 +201,19 @@ public final class LauncherInstrumentation {

    Closable addContextLayer(String piece) {
        mDiagnosticContext.addLast(piece);
        return () -> mDiagnosticContext.removeLast();
        log("Added context: " + getContextDescription());
        return () -> {
            log("Removing context: " + getContextDescription());
            mDiagnosticContext.removeLast();
        };
    }

    private void fail(String message) {
        final String ctxt = mDiagnosticContext.isEmpty() ? "" : String.join(", ",
                mDiagnosticContext) + "; ";
        Assert.fail("http://go/tapl : " + ctxt + message);
        Assert.fail("http://go/tapl : " + getContextDescription() + message);
    }

    private String getContextDescription() {
        return mDiagnosticContext.isEmpty() ? "" : String.join(", ", mDiagnosticContext) + "; ";
    }

    void assertTrue(String message, boolean condition) {