private void finish(Result result) {
    if (mState == State.DONE) {
      // Not permitted to change state when already DONE
      return;
    }
    if (mBackgroundExecutorServiceOwnedByThisController) {
      ((ExecutorService) mBackgroundExecutor).shutdownNow();
    }
    mState = State.DONE;
    mResult = result;
    if (mPresenter != null) {
      mPresenter.onDone(result);
    }
  }
Terminates this controller's operation with the provided result/outcome.
java/com/google/android/apps/authenticator/timesync/SyncNowController.java