コード例 #1
0
  /**
   * Handles when the speech controller finished speaking an instruction.
   *
   * @param status The speech item status code from the speech controller.
   */
  private void onUtteranceComplete(int status) {
    setTouchGuardActive(false);
    mFeedbackController.playSound(R.raw.ready, 1.0f, 1.0f);
    unlockOrientation();

    if (sTutorialIsActive && (mResourceIdToRepeat > 0)) {
      mRepeatHandler.sendEmptyMessageDelayed(RepeatHandler.MSG_REPEAT, REPEAT_DELAY);
    }
  }
コード例 #2
0
  @Override
  protected void onPause() {
    super.onPause();
    sTutorialIsActive = false;

    final TalkBackService service = TalkBackService.getInstance();
    if (service != null) {
      service.removeServiceStateListener(mServiceStateListener);
    }

    getCurrentModule().onPause();

    interrupt();

    // This is different than stopRepeating because we want the current
    // instruction text to continue repeating if the activity resumes.
    mRepeatHandler.removeMessages(RepeatHandler.MSG_REPEAT);

    unlockOrientation();
  }