code: private void executeOnLooper(ControlRunnable runnable) {
      if (Thread.currentThread() == realLooper.getThread()) {
        runnable.run();
      } else {
        if (realLooper.equals(Looper.getMainLooper())) {
          throw new UnsupportedOperationException(
              "main looper can only be controlled from main thread");
        }
        looperExecutor.execute(runnable);
        runnable.waitTillComplete();
      }
    }
docs: Executes the given runnable on the loopers thread, and waits for it to complete.