public void attach(Presenter presenter) {
    mPresenter = presenter;
    switch (mState) {
      case NOT_STARTED:
        start();
        break;
      case IN_PROGRESS:
        if (mPresenter != null) {
          mPresenter.onStarted();
        }
        break;
      case DONE:
        if (mPresenter != null) {
          mPresenter.onDone(mResult);
        }
        break;
      default:
        throw new IllegalStateException(String.valueOf(mState));
    }
  }
Attaches the provided presentation layer to this controller. The previously attached
presentation layer (if any) stops receiving events from this controller.
java/com/google/android/apps/authenticator/timesync/SyncNowController.java