示例#1
0
 /**
  * Begin a sync.
  *
  * <p>The caller is responsible for:
  *
  * <ul>
  *   <li>Verifying that any backoffs/minimum next sync requests are respected.
  *   <li>Ensuring that the device is online.
  *   <li>Ensuring that dependencies are ready.
  * </ul>
  *
  * @throws AlreadySyncingException
  */
 public void start() throws AlreadySyncingException {
   if (this.currentState != GlobalSyncStage.Stage.idle) {
     throw new AlreadySyncingException(this.currentState);
   }
   installAsHttpResponseObserver(); // Uninstalled by completeSync or abort.
   this.advance();
 }