code: private void updateStopRunnable(final int action) {
          if (stopRunnable != null) {
              if (action == 0) {
                  handler.removeCallbacks(stopRunnable);
              } else if (action == 1) {
                  handler.removeCallbacks(stopRunnable);
                  handler.postDelayed(stopRunnable, STOP_DELAY);
              }
          }
      }
docs: Manage recognizer cancellation runnable.
  
  @param action (int) (0 - stop, 1 - restart)