private String executeShellCommand(String cmd) throws Exception {
    ParcelFileDescriptor pfd = uiAutomation.executeShellCommand(cmd);
    StringBuilder stdout = new StringBuilder();
    try (FileInputStream inputStream = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) {
      byte[] buffer = new byte[1024];
      int bytesRead = 0;

      while ((bytesRead = inputStream.read(buffer)) != -1) {
        stdout.append(new String(buffer, 0, bytesRead, UTF_8));
      }
    }

    Log.i(TAG, "$ adb shell " + cmd + "\n" + stdout);
    return stdout.toString().trim(); // trim trailing newline
  }
How long we're willing to wait for a job to run after it becomes eligible.
jobdispatcher/src/androidTest/java/com/firebase/jobdispatcher/AirplaneModeAndroidTest.java