From 2e6fdd7d93c7f480d88c77c717ab3359677943b0 Mon Sep 17 00:00:00 2001 From: vadimt Date: Mon, 27 Apr 2020 13:08:50 -0700 Subject: [PATCH] Optimization: reducing number of getNavigationModeMismatchError calls They are relatively expensive Change-Id: I34de56884ec3f88e69c709026d3b72e62c787681 --- .../android/launcher3/tapl/LauncherInstrumentation.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index debc736ac2..d46845f118 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -535,13 +535,14 @@ public final class LauncherInstrumentation { mExpectedRotation, mDevice.getDisplayRotation()); // b/148422894 + String error = null; for (int i = 0; i != 600; ++i) { - if (getNavigationModeMismatchError() == null) break; + error = getNavigationModeMismatchError(); + if (error == null) break; sleep(100); } - - final String error = getNavigationModeMismatchError(); assertTrue(error, error == null); + log("verifyContainerType: " + containerType); final UiObject2 container = verifyVisibleObjects(containerType);