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

Commit 7a10226e authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Print error log if fail to connect to UiAutomator

Test: run `atest CtsShortFgsTestCases` after changing timeout to 0,
  and check log
Bug: 266521938
Change-Id: Ib66d89a3ac6ef99a2dbcec9748d36e8030d6b803
parent 50fce419
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2324,10 +2324,13 @@ public class Instrumentation {
                mUiAutomation.connect(flags);
                return mUiAutomation;
            }
            final long startUptime = SystemClock.uptimeMillis();
            try {
                mUiAutomation.connectWithTimeout(flags, CONNECT_TIMEOUT_MILLIS);
                return mUiAutomation;
            } catch (TimeoutException e) {
                final long waited = SystemClock.uptimeMillis() - startUptime;
                Log.e(TAG, "Unable to connect to UiAutomation. Waited for " + waited + " ms", e);
                mUiAutomation.destroy();
                mUiAutomation = null;
            }