Example #1
0
 /**
  * Updates the uptime history with the current uptime. Package access for testing.
  *
  * @param currentUptime the current uptime in seconds
  */
 void updateUptimeHistory(long currentUptime) {
   String[] uptimes = ApplicationSettings.UPTIME_HISTORY.get();
   // The first update in each session should append to the array
   if (firstUptimeUpdate.getAndSet(false))
     uptimes = appendToHistory(uptimes, Long.toString(currentUptime));
   else uptimes = updateHistory(uptimes, Long.toString(currentUptime));
   ApplicationSettings.UPTIME_HISTORY.set(uptimes);
 }