code: private boolean addHisoricalRecord(HistoricalRecord historicalRecord) {
          final boolean added = mHistoricalRecords.add(historicalRecord);
          if (added) {
              mHistoricalRecordsChanged = true;
              pruneExcessiveHistoricalRecordsIfNeeded();
              persistHistoricalDataIfNeeded();
              sortActivitiesIfNeeded();
              notifyChanged();
          }
          return added;
      }
docs: Adds a historical record.
  
  @param historicalRecord The record to add.
  @return True if the record was added.