code: private void persistHistoricalDataIfNeeded() {
          if (!mReadShareHistoryCalled) {
              throw new IllegalStateException("No preceding call to #readHistoricalData");
          }
          if (!mHistoricalRecordsChanged) {
              return;
          }
          mHistoricalRecordsChanged = false;
          if (!TextUtils.isEmpty(mHistoryFileName)) {
              if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                  executePersistHistoryAsyncTaskSDK11();
              } else {
                  executePersistHistoryAsyncTaskBase();
              }
          }
      }
docs: Persists the history data to the backing file if the latter
  was provided. Calling this method before a call to {@link #readHistoricalDataIfNeeded()}
  throws an exception. Calling this method more than one without choosing an
  activity has not effect.
  
  @throws IllegalStateException If this method is called before a call to
  {@link #readHistoricalDataIfNeeded()}.