am 43861f9d: am f46449ab: Merge "Avoid IllegalArgumentException in Preference.java compareTo()"
* commit '43861f9de965593340f6a63c270120a7f1a8701c':
Avoid IllegalArgumentException in Preference.java compareTo()
diff --git a/core/java/android/preference/Preference.java b/core/java/android/preference/Preference.java
index e343e83..6c02965 100644
--- a/core/java/android/preference/Preference.java
+++ b/core/java/android/preference/Preference.java
@@ -1072,6 +1072,9 @@
|| (mOrder == DEFAULT_ORDER && another.mOrder != DEFAULT_ORDER)) {
// Do order comparison
return mOrder - another.mOrder;
+ } else if (mTitle == another.mTitle) {
+ // If titles are null or share same object comparison
+ return 0;
} else if (mTitle == null) {
return 1;
} else if (another.mTitle == null) {