code: private void setLastAlarmTime(long millisBeforeNow) {
          SharedPreferences.Editor editor = mPrefs.edit();
          editor.putLong(constructKey(LAST_ALARM_ELAPSED_TIME_SUFFIX),
              SystemClock.elapsedRealtime() - millisBeforeNow);
          editor.putLong(constructKey(LAST_ALARM_CLOCK_TIME_SUFFIX),
              System.currentTimeMillis() - millisBeforeNow);
          editor.apply();
      }
docs: Store the time the alarm last fired, both as elapsed time since boot (using
  {@link SystemClock#elapsedRealtime()}) and as standard "wall" clock time (using
  {@link System#currentTimeMillis()}. We generally want to set our alarms based on the elapsed
  time since booting as that is not affected by the system clock being reset. However, we use
  the clock time to set the alarm after a reboot as clearly in this case the time since boot is
  useless.
  @param millisBeforeNow The number of milliseconds before the current time at which to record
  that the alarm should have last fired.