summaryrefslogtreecommitdiffstats
path: root/core/java/android/util/TimeUtils.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-06-27 15:43:45 -0700
committerJeff Sharkey <jsharkey@android.com>2015-07-01 15:48:34 -0700
commite8a4b66960056c2dc2c8dbb5f8df00710645cc64 (patch)
treefcdb9ff992b8a3ca305013d311b82d1860c3f7bc /core/java/android/util/TimeUtils.java
parent8a752abe77a4387bbe099befa972870ee0a48bbf (diff)
downloadframeworks_base-e8a4b66960056c2dc2c8dbb5f8df00710645cc64.zip
frameworks_base-e8a4b66960056c2dc2c8dbb5f8df00710645cc64.tar.gz
frameworks_base-e8a4b66960056c2dc2c8dbb5f8df00710645cc64.tar.bz2
Better handling of trim/benchmark results.
Request benchmarking of devices once per week during normal fstrim maintenance window. Tunable parameter gives us the ability to change frequency through global setting. Track individual benchmark and trim results for each volume, and use scrubbed volume identifier (based on adoptiong age) when logging stats to drop box. Track last benchmark and trim time for each volume separately. Bug: 21831325 Change-Id: I53b3ed788f7820c2e5bceb2840339f5b4aada3f0
Diffstat (limited to 'core/java/android/util/TimeUtils.java')
-rw-r--r--core/java/android/util/TimeUtils.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java
index 353388d..c1eb80d 100644
--- a/core/java/android/util/TimeUtils.java
+++ b/core/java/android/util/TimeUtils.java
@@ -28,6 +28,7 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
@@ -54,6 +55,8 @@ public class TimeUtils {
private static ArrayList<TimeZone> sLastUniqueZoneOffsets = null;
private static String sLastUniqueCountry = null;
+ /** {@hide} */
+ private static SimpleDateFormat sLoggingFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* Tries to return a time zone that would have had the specified offset
@@ -441,4 +444,13 @@ public class TimeUtils {
return Long.toString(millis);
}
}
+
+ /** {@hide} */
+ public static String formatForLogging(long millis) {
+ if (millis <= 0) {
+ return "unknown";
+ } else {
+ return sLoggingFormat.format(new Date(millis));
+ }
+ }
}