/** * Speaks the previously stored instruction text again. * * <p>Assumes that {@code mTextToRepeat} is non-null. */ private void repeatInstruction() { if (!sTutorialIsActive) { mRepeatHandler.removeMessages(RepeatHandler.MSG_REPEAT); return; } lockOrientation(); setTouchGuardActive(true); speakInternal(mResourceIdToRepeat, mRepeatedFormatArgs); }
@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(); }
/** * Stops the current instruction from repeating in the future. * * <p>Note: this carries over even after the activity is paused and resumed. */ public void stopRepeating() { mRepeatHandler.removeMessages(RepeatHandler.MSG_REPEAT); mResourceIdToRepeat = 0; }