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

Commit 94027c72 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Use Locale.ROOT for locale neutral operations

Bug: 9112465
Change-Id: I6cd63007287b5a1a57cfbabff35d53f66fc5620e
parent ebe0544f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public final class LocaleUtils {
    public static String getMatchLevelSortedString(final int matchLevel) {
        // This works because the match levels are 0~99 (actually 0~30)
        // Ideally this should use a number of digits equals to the 1og10 of the greater matchLevel
        return String.format("%02d", MATCH_LEVEL_MAX - matchLevel);
        return String.format(Locale.ROOT, "%02d", MATCH_LEVEL_MAX - matchLevel);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public class Key implements Comparable<Key> {
        } else {
            label = "/" + mLabel;
        }
        return String.format("%s%s %d,%d %dx%d %s/%s/%s",
        return String.format(Locale.ROOT, "%s%s %d,%d %dx%d %s/%s/%s",
                Constants.printableCode(mCode), label, mX, mY, mWidth, mHeight, mHintLabel,
                KeyboardIconsSet.getIconName(mIconId), backgroundName(mBackgroundType));
    }
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public final class KeyboardId {
    public String toString() {
        final String orientation = (mOrientation == Configuration.ORIENTATION_PORTRAIT)
                ? "port" : "land";
        return String.format("[%s %s:%s %s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]",
        return String.format(Locale.ROOT, "[%s %s:%s %s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]",
                elementIdToName(mElementId),
                mLocale,
                mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ public final class LocaleUtils {
    public static String getMatchLevelSortedString(int matchLevel) {
        // This works because the match levels are 0~99 (actually 0~30)
        // Ideally this should use a number of digits equals to the 1og10 of the greater matchLevel
        return String.format("%02d", MATCH_LEVEL_MAX - matchLevel);
        return String.format(Locale.ROOT, "%02d", MATCH_LEVEL_MAX - matchLevel);
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -379,7 +379,8 @@ public final class Suggest {
                    typedWord, cur.toString(), cur.mScore);
            final String scoreInfoString;
            if (normalizedScore > 0) {
                scoreInfoString = String.format("%d (%4.2f)", cur.mScore, normalizedScore);
                scoreInfoString = String.format(
                        Locale.ROOT, "%d (%4.2f)", cur.mScore, normalizedScore);
            } else {
                scoreInfoString = Integer.toString(cur.mScore);
            }
Loading