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

Commit 607223f3 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Remove uses of libcore.util.Objects.hashCode / equals.

Use public API in java.util.Objects instead.

Test: make
Change-Id: I413280f254743a2efa2640a2194693aeb5980605
parent 944836c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package android.hardware.display;
import android.os.Parcel;
import android.os.Parcelable;

import libcore.util.Objects;
import java.util.Objects;

/**
 * Describes the properties of a Wifi display.
@@ -140,7 +140,7 @@ public final class WifiDisplay implements Parcelable {
        return other != null
                && mDeviceAddress.equals(other.mDeviceAddress)
                && mDeviceName.equals(other.mDeviceName)
                && Objects.equal(mDeviceAlias, other.mDeviceAlias);
                && Objects.equals(mDeviceAlias, other.mDeviceAlias);
    }

    /**
+4 −5
Original line number Diff line number Diff line
@@ -16,13 +16,12 @@

package android.util;

import libcore.util.Objects;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;

/**
@@ -143,8 +142,8 @@ abstract class MapCollections<K, V> {
                return false;
            }
            Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
            return Objects.equal(e.getKey(), colGetEntry(mIndex, 0))
                    && Objects.equal(e.getValue(), colGetEntry(mIndex, 1));
            return Objects.equals(e.getKey(), colGetEntry(mIndex, 0))
                    && Objects.equals(e.getValue(), colGetEntry(mIndex, 1));
        }

        @Override
@@ -195,7 +194,7 @@ abstract class MapCollections<K, V> {
                return false;
            }
            Object foundVal = colGetEntry(index, 1);
            return Objects.equal(foundVal, e.getValue());
            return Objects.equals(foundVal, e.getValue());
        }

        @Override
+6 −7
Original line number Diff line number Diff line
@@ -31,9 +31,8 @@ import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.proto.ProtoOutputStream;

import libcore.util.Objects;

import java.util.Arrays;
import java.util.Objects;

/**
 * Describes the characteristics of a particular logical display.
@@ -295,8 +294,8 @@ public final class DisplayInfo implements Parcelable {
                && layerStack == other.layerStack
                && flags == other.flags
                && type == other.type
                && Objects.equal(address, other.address)
                && Objects.equal(uniqueId, other.uniqueId)
                && Objects.equals(address, other.address)
                && Objects.equals(uniqueId, other.uniqueId)
                && appWidth == other.appWidth
                && appHeight == other.appHeight
                && smallestNominalAppWidth == other.smallestNominalAppWidth
@@ -309,13 +308,13 @@ public final class DisplayInfo implements Parcelable {
                && overscanTop == other.overscanTop
                && overscanRight == other.overscanRight
                && overscanBottom == other.overscanBottom
                && Objects.equal(displayCutout, other.displayCutout)
                && Objects.equals(displayCutout, other.displayCutout)
                && rotation == other.rotation
                && modeId == other.modeId
                && defaultModeId == other.defaultModeId
                && colorMode == other.colorMode
                && Arrays.equals(supportedColorModes, other.supportedColorModes)
                && Objects.equal(hdrCapabilities, other.hdrCapabilities)
                && Objects.equals(hdrCapabilities, other.hdrCapabilities)
                && logicalDensityDpi == other.logicalDensityDpi
                && physicalXDpi == other.physicalXDpi
                && physicalYDpi == other.physicalYDpi
@@ -323,7 +322,7 @@ public final class DisplayInfo implements Parcelable {
                && presentationDeadlineNanos == other.presentationDeadlineNanos
                && state == other.state
                && ownerUid == other.ownerUid
                && Objects.equal(ownerPackageName, other.ownerPackageName)
                && Objects.equals(ownerPackageName, other.ownerPackageName)
                && removeMode == other.removeMode;
    }

+4 −5
Original line number Diff line number Diff line
@@ -69,8 +69,6 @@ import com.android.internal.R;
import com.android.internal.util.NotificationColorUtil;
import com.android.internal.util.Preconditions;

import libcore.util.Objects;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -82,6 +80,7 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Stack;
import java.util.concurrent.Executor;

@@ -291,9 +290,9 @@ public class RemoteViews implements Parcelable, Filter {
                return false;
            }
            MethodKey p = (MethodKey) o;
            return Objects.equal(p.targetClass, targetClass)
                    && Objects.equal(p.paramClass, paramClass)
                    && Objects.equal(p.methodName, methodName);
            return Objects.equals(p.targetClass, targetClass)
                    && Objects.equals(p.paramClass, paramClass)
                    && Objects.equals(p.methodName, methodName);
        }

        @Override
+2 −3
Original line number Diff line number Diff line
@@ -20,10 +20,9 @@ package com.android.internal.util;
import android.annotation.Nullable;
import android.text.TextUtils;

import libcore.util.Objects;

import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
import java.util.UUID;
import java.util.function.IntFunction;

@@ -56,7 +55,7 @@ public final class BitUtils {

    public static boolean maskedEquals(UUID a, UUID b, @Nullable UUID mask) {
        if (mask == null) {
            return Objects.equal(a, b);
            return Objects.equals(a, b);
        }
        return maskedEquals(a.getLeastSignificantBits(), b.getLeastSignificantBits(),
                    mask.getLeastSignificantBits())
Loading