private void setAirplaneModeEnabled(boolean enabled) throws Exception {
    Log.i(TAG, "Setting airplane mode to " + enabled);

    String value = String.valueOf(enabled ? 1 : 0);

    // Update the setting
    executeShellCommand("settings put global airplane_mode_on " + value);

    // Check the setting took
    String newSetting = executeShellCommand("settings get global airplane_mode_on");
    assertThat(newSetting).isEqualTo(value);

    // Let everything know we flipped the setting
    executeShellCommand("am broadcast -a android.intent.action.AIRPLANE_MODE");
  }
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