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

Commit 26e56546 authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Add ImeSubtypeListItem equals and hashCode" into main

parents 45f338a0 69343de8
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -196,15 +196,28 @@ final class InputMethodSubtypeSwitchingController {
        }

        @Override
        public boolean equals(Object o) {
            if (o == this) {
        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (o instanceof ImeSubtypeListItem that) {
                return Objects.equals(mImi, that.mImi) && mSubtypeIndex == that.mSubtypeIndex;
            }
            if (!(obj instanceof ImeSubtypeListItem that)) {
                return false;
            }
            return TextUtils.equals(mImeName, that.mImeName)
                    && TextUtils.equals(mSubtypeName, that.mSubtypeName)
                    && TextUtils.equals(mLayoutName, that.mLayoutName)
                    && mImi.equals(that.mImi)
                    && mSubtypeIndex == that.mSubtypeIndex
                    && mShowInImeSwitcherMenu == that.mShowInImeSwitcherMenu
                    && mIsAuxiliary == that.mIsAuxiliary
                    && mSuitableForHardware == that.mSuitableForHardware;
        }

        @Override
        public int hashCode() {
            return Objects.hash(mImeName, mSubtypeName, mLayoutName, mImi, mSubtypeIndex,
                    mShowInImeSwitcherMenu, mIsAuxiliary, mSuitableForHardware);
        }

        /**
         * Compares two character sequences lexicographically. For historical reasons, an empty