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

Commit b46886f4 authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am f518ad0a: Merge "IndexOutOfBoundsException on addPreference in PreferenceGroup"

* commit 'f518ad0a':
  IndexOutOfBoundsException on addPreference in PreferenceGroup
parents 2235ecd5 f518ad0a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -148,16 +148,15 @@ public abstract class PreferenceGroup extends Preference implements GenericInfla
            }
        }

        int insertionIndex = Collections.binarySearch(mPreferenceList, preference);
        if (insertionIndex < 0) {
            insertionIndex = insertionIndex * -1 - 1;
        }

        if (!onPrepareAddPreference(preference)) {
            return false;
        }

        synchronized(this) {
            int insertionIndex = Collections.binarySearch(mPreferenceList, preference);
            if (insertionIndex < 0) {
                insertionIndex = insertionIndex * -1 - 1;
            }
            mPreferenceList.add(insertionIndex, preference);
        }