@Override
  public void execute(Runnable command) {
    if (Thread.currentThread() == handler.getLooper().getThread()) {
      // The calling thread is the target thread of the Handler -- invoke immediately, blocking
      // the calling thread.
      command.run();
    } else {
      // The calling thread is not the same as the thread with which the Handler is associated --
      // post to the Handler for later execution.
      handler.post(command);
    }
  }
{@link Executor} that invokes {@link Runnable} instances on the thread on which it was created.
The assumption is that the thread has a {@link android.os.Looper} associated with it.
java/com/google/android/apps/authenticator/util/concurrent/RunOnThisLooperThreadExecutor.java