am f518ad0a: Merge "IndexOutOfBoundsException on addPreference in PreferenceGroup"
* commit 'f518ad0a4941236b72b5d090320d4ab70ebbf26b': IndexOutOfBoundsException on addPreference in PreferenceGroup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user