Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 919f606d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update battery strings to respect user 24 hour setting" into pi-dev

parents 1024314c b9e8cfa5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);

+2 −2
Original line number Diff line number Diff line
@@ -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%\\)";