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

Commit 0197aff1 authored by Salvador Martinez's avatar Salvador Martinez Committed by android-build-merger
Browse files

Merge "Update battery strings to respect user 24 hour setting" into pi-dev am: 919f606d

am: a329512e

Change-Id: I58892023fb0108351840f6693739f5e5834a7ed9
parents 1aaac19f a329512e
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%\\)";