Merge "Update battery strings to respect user 24 hour setting" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
919f606df9
@@ -144,7 +144,8 @@ public class PowerUtil {
|
||||
FIFTEEN_MINUTES_MILLIS);
|
||||
|
||||
// convert the time to a properly formatted string.
|
||||
DateFormat fmt = DateFormat.getTimeInstance(DateFormat.SHORT);
|
||||
String skeleton = android.text.format.DateFormat.getTimeFormatString(context);
|
||||
DateFormat fmt = DateFormat.getInstanceForSkeleton(skeleton);
|
||||
Date date = Date.from(Instant.ofEpochMilli(roundedTimeOfDayMs));
|
||||
CharSequence timeString = fmt.format(date);
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ public class PowerUtilTest {
|
||||
public static final long THIRTY_HOURS_MILLIS = Duration.ofHours(30).toMillis();
|
||||
public static final String NORMAL_CASE_EXPECTED_PREFIX = "Should last until about";
|
||||
public static final String ENHANCED_SUFFIX = " based on your usage";
|
||||
// matches a time (ex: '1:15 PM', '2 AM')
|
||||
public static final String TIME_OF_DAY_REGEX = " (\\d)+:?(\\d)* (AM)|(PM)";
|
||||
// matches a time (ex: '1:15 PM', '2 AM', '23:00')
|
||||
public static final String TIME_OF_DAY_REGEX = " (\\d)+:?(\\d)* ((AM)*)|((PM)*)";
|
||||
// matches a percentage with parenthesis (ex: '(10%)')
|
||||
public static final String PERCENTAGE_REGEX = " \\(\\d?\\d%\\)";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user