Display the chart levels data into BatteryHistoryPreference
Bug: 184807417 Bug: 180607918 Test: make SettingsRoboTests Test: make SettingsGoogleRoboTests Change-Id: I78718a59671ca6775abc725432fbfbec6c0993fe
This commit is contained in:
@@ -25,11 +25,16 @@ import android.util.Log;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/** A utility class to convert data into another types. */
|
||||
public final class ConvertUtils {
|
||||
private static final String TAG = "ConvertUtils";
|
||||
private static final SimpleDateFormat SIMPLE_DATE_FORMAT =
|
||||
new SimpleDateFormat("MMM dd,yyyy HH:mm:ss", Locale.ENGLISH);
|
||||
/** Invalid system battery consumer drain type. */
|
||||
public static final int INVALID_DRAIN_TYPE = -1;
|
||||
|
||||
@@ -101,5 +106,10 @@ public final class ConvertUtils {
|
||||
return values;
|
||||
}
|
||||
|
||||
/** Converts UTC timestamp to human readable local time string. */
|
||||
public static String utcToLocalTime(long timestamp) {
|
||||
return SIMPLE_DATE_FORMAT.format(new Date(timestamp));
|
||||
}
|
||||
|
||||
private ConvertUtils() {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user