private boolean sendOrderedBroadcastAndGetResult(Intent intent) {
    try {
      final SettableFuture<Boolean> moreWorkFuture = SettableFuture.create();
      sendOrderedBroadcast(
          /* intent= */ intent,
          /* receiverPermission= */ null,
          /* resultReceiver= */ new BroadcastReceiver() {
            @Override
            public void onReceive(Context unused, Intent intent) {
              moreWorkFuture.set(
                  getResultExtras(/* makeMap= */ true).getBoolean(EXTRA_MORE_WORK_REMAINING));
            }
          },
          // this is being called on the main thread, so we need our receiver to run elsewhere
          /* scheduler= */ handlerFuture.get(),
          /* initialCode= */ 0,
          /* initialData= */ null,
          /* initialExtras= */ null);

      // Wait for 5 seconds, which is the longest we expect this broadcast chain to take
      return moreWorkFuture.get(5, SECONDS);
    } catch (TimeoutException | InterruptedException | ExecutionException e) {
      throw new RuntimeException(e); // crash the process
    }
  }
A JobService that's configured via the manifest to run in a different process.
jobdispatcher/src/testLib/com/firebase/jobdispatcher/WorkerProcessTestJobService.java