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

Commit 875ab2b3 authored by Winson Chiu's avatar Winson Chiu Committed by Automerger Merge Worker
Browse files

Merge "Accept generic in SparseArray contentEquals" into sc-dev am: 90b5c663

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13691245

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I696f443f322801acbc1dc5f971436999c3bcb612
parents 566a52d0 90b5c663
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45876,7 +45876,7 @@ package android.util {
    method public void clear();
    method public android.util.SparseArray<E> clone();
    method public boolean contains(int);
    method public boolean contentEquals(@Nullable android.util.SparseArray<E>);
    method public boolean contentEquals(@Nullable android.util.SparseArray<?>);
    method public int contentHashCode();
    method public void delete(int);
    method public E get(int);
+6 −1
Original line number Diff line number Diff line
@@ -510,10 +510,12 @@ public class SparseArray<E> implements Cloneable {
    }

    /**
     * Compares the contents of this {@link SparseArray} to the specified {@link SparseArray}.
     *
     * For backwards compatibility reasons, {@link Object#equals(Object)} cannot be implemented,
     * so this serves as a manually invoked alternative.
     */
    public boolean contentEquals(@Nullable SparseArray<E> other) {
    public boolean contentEquals(@Nullable SparseArray<?> other) {
        if (other == null) {
            return false;
        }
@@ -534,6 +536,9 @@ public class SparseArray<E> implements Cloneable {
    }

    /**
     * Returns a hash code value for the contents of this {@link SparseArray}, combining the
     * {@link Objects#hashCode(Object)} result of all its keys and values.
     *
     * For backwards compatibility, {@link Object#hashCode()} cannot be implemented, so this serves
     * as a manually invoked alternative.
     */