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

Commit 7709041c authored by Felipe Leme's avatar Felipe Leme
Browse files

Removed warning when objects are added on wrong order.

append() is used to optimized insertions in the array, but it must
preserve the order of the hashcode array; when it doesn't, it falls back
to append(), but it should not log a warning message

In particular, PendingIntentRecords might have different hashcodes
across different processes.

Fixes: 29912192
Change-Id: I0ab566249829ddb934fd51cf21399b68cb286bd5
parent 4b736ea5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -402,11 +402,14 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
            throw new IllegalStateException("Array is full");
        }
        if (index > 0 && mHashes[index - 1] > hash) {
            // Cannot optimize since it would break the sorted order - fallback to add()
            if (DEBUG) {
                RuntimeException e = new RuntimeException("here");
                e.fillInStackTrace();
                Log.w(TAG, "New hash " + hash
                        + " is before end of array hash " + mHashes[index - 1]
                        + " at index " + index, e);
            }
            add(value);
            return;
        }