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

Commit c6dcb817 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename isValidSubtypeId() to isValidSubtypeHashCode()" into main

parents 0c0fbd27 825c7a1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ final class InputMethodSettings {
                            try {
                                final int hashCode = Integer.parseInt(subtypeHashCode);
                                // Check whether the subtype id is valid or not
                                if (SubtypeUtils.isValidSubtypeId(imi, hashCode)) {
                                if (SubtypeUtils.isValidSubtypeHashCode(imi, hashCode)) {
                                    return s;
                                } else {
                                    return NOT_A_SUBTYPE_ID_STR;
@@ -644,7 +644,7 @@ final class InputMethodSettings {
            if (subtypeHashCode == NOT_A_SUBTYPE_ID) {
                continue;  // NOT_A_SUBTYPE_ID must not be saved
            }
            if (!SubtypeUtils.isValidSubtypeId(imi, subtypeHashCode)) {
            if (!SubtypeUtils.isValidSubtypeHashCode(imi, subtypeHashCode)) {
                continue;  // this subtype does not exist in InputMethodInfo.
            }
            if (validSubtypeHashCodes.indexOf(subtypeHashCode) >= 0) {
+2 −2
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ final class SubtypeUtils {
        return subtypes;
    }

    static boolean isValidSubtypeId(InputMethodInfo imi, int subtypeHashCode) {
    static boolean isValidSubtypeHashCode(InputMethodInfo imi, int subtypeHashCode) {
        return getSubtypeIdFromHashCode(imi, subtypeHashCode) != NOT_A_SUBTYPE_ID;
    }

@@ -312,7 +312,7 @@ final class SubtypeUtils {
        final int selectedSubtypeHashCode = SecureSettingsWrapper.getInt(
                Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID, userId);
        if (selectedSubtypeHashCode != NOT_A_SUBTYPE_ID && currentSubtype != null
                && isValidSubtypeId(imi, currentSubtype.hashCode())) {
                && isValidSubtypeHashCode(imi, currentSubtype.hashCode())) {
            return currentSubtype;
        }