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

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

Merge "Add log for StringUtil"

parents efd71f89 1aedf076
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.icu.util.ULocale;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.TtsSpan;
import android.util.Log;

import com.android.settingslib.R;

@@ -36,6 +37,8 @@ import java.util.Locale;
/** Utility class for generally useful string methods **/
public class StringUtil {

    private static final String TAG = "StringUtil";

    public static final int SECONDS_PER_MINUTE = 60;
    public static final int SECONDS_PER_HOUR = 60 * 60;
    public static final int SECONDS_PER_DAY = 24 * 60 * 60;
@@ -94,6 +97,7 @@ public class StringUtil {
        final Locale locale = context.getResources().getConfiguration().locale;
        final MeasureFormat measureFormat = MeasureFormat.getInstance(
                locale, FormatWidth.SHORT);
        Log.i(TAG, "Locale is: " + locale);
        sb.append(measureFormat.formatMeasures(measureArray));

        if (measureArray.length == 1 && MeasureUnit.MINUTE.equals(measureArray[0].getUnit())) {
@@ -146,6 +150,7 @@ public class StringUtil {
                null /* default NumberFormat */,
                RelativeDateTimeFormatter.Style.LONG,
                android.icu.text.DisplayContext.CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE);
        Log.i(TAG, "Locale is: " + locale);

        return formatter.format(value, RelativeDateTimeFormatter.Direction.LAST, unit);
    }