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

Commit 37c69fdd authored by Kenny Root's avatar Kenny Root Committed by Gerrit Code Review
Browse files

Merge "Use java.util.Objects instead on internal API"

parents 584ace0d e6585b32
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ import com.android.internal.os.BinderInternal;
import com.android.internal.os.RuntimeInit;
import com.android.internal.os.SamplingProfilerIntegration;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.Objects;
import com.android.org.conscrypt.OpenSSLSocketImpl;
import com.google.android.collect.Lists;

@@ -109,6 +108,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.TimeZone;
import java.util.regex.Pattern;

@@ -222,7 +222,7 @@ public final class ActivityThread {
        public boolean equals(Object o) {
            if (o instanceof ProviderKey) {
                final ProviderKey other = (ProviderKey) o;
                return Objects.equal(authority, other.authority) && userId == other.userId;
                return Objects.equals(authority, other.authority) && userId == other.userId;
            }
            return false;
        }
+4 −4
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import android.net.wifi.WifiManager;
import android.os.Build;
import android.telephony.TelephonyManager;

import com.android.internal.util.Objects;
import java.util.Objects;

/**
 * Network definition that includes strong identity. Analogous to combining
@@ -60,7 +60,7 @@ public class NetworkIdentity {

    @Override
    public int hashCode() {
        return Objects.hashCode(mType, mSubType, mSubscriberId, mNetworkId, mRoaming);
        return Objects.hash(mType, mSubType, mSubscriberId, mNetworkId, mRoaming);
    }

    @Override
@@ -68,8 +68,8 @@ public class NetworkIdentity {
        if (obj instanceof NetworkIdentity) {
            final NetworkIdentity ident = (NetworkIdentity) obj;
            return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming
                    && Objects.equal(mSubscriberId, ident.mSubscriberId)
                    && Objects.equal(mNetworkId, ident.mNetworkId);
                    && Objects.equals(mSubscriberId, ident.mSubscriberId)
                    && Objects.equals(mNetworkId, ident.mNetworkId);
        }
        return false;
    }
+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import static com.android.internal.util.Preconditions.checkNotNull;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.internal.util.Objects;
import java.util.Objects;

/**
 * Policy for networks matching a {@link NetworkTemplate}, including usage cycle
@@ -146,7 +146,7 @@ public class NetworkPolicy implements Parcelable, Comparable<NetworkPolicy> {

    @Override
    public int hashCode() {
        return Objects.hashCode(template, cycleDay, cycleTimezone, warningBytes, limitBytes,
        return Objects.hash(template, cycleDay, cycleTimezone, warningBytes, limitBytes,
                lastWarningSnooze, lastLimitSnooze, metered, inferred);
    }

@@ -159,8 +159,8 @@ public class NetworkPolicy implements Parcelable, Comparable<NetworkPolicy> {
                    && lastWarningSnooze == other.lastWarningSnooze
                    && lastLimitSnooze == other.lastLimitSnooze && metered == other.metered
                    && inferred == other.inferred
                    && Objects.equal(cycleTimezone, other.cycleTimezone)
                    && Objects.equal(template, other.template);
                    && Objects.equals(cycleTimezone, other.cycleTimezone)
                    && Objects.equals(template, other.template);
        }
        return false;
    }
+3 −3
Original line number Diff line number Diff line
@@ -23,12 +23,12 @@ import android.util.SparseBooleanArray;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Objects;

import java.io.CharArrayWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;

/**
 * Collection of active network statistics. Can contain summary details across
@@ -337,7 +337,7 @@ public class NetworkStats implements Parcelable {
    public int findIndex(String iface, int uid, int set, int tag) {
        for (int i = 0; i < size; i++) {
            if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i]
                    && Objects.equal(iface, this.iface[i])) {
                    && Objects.equals(iface, this.iface[i])) {
                return i;
            }
        }
@@ -362,7 +362,7 @@ public class NetworkStats implements Parcelable {
            }

            if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i]
                    && Objects.equal(iface, this.iface[i])) {
                    && Objects.equals(iface, this.iface[i])) {
                return i;
            }
        }
+7 −6
Original line number Diff line number Diff line
@@ -34,8 +34,9 @@ import android.content.res.Resources;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Objects;

/**
 * Template definition used to generically match {@link NetworkIdentity},
@@ -176,7 +177,7 @@ public class NetworkTemplate implements Parcelable {

    @Override
    public int hashCode() {
        return Objects.hashCode(mMatchRule, mSubscriberId, mNetworkId);
        return Objects.hash(mMatchRule, mSubscriberId, mNetworkId);
    }

    @Override
@@ -184,8 +185,8 @@ public class NetworkTemplate implements Parcelable {
        if (obj instanceof NetworkTemplate) {
            final NetworkTemplate other = (NetworkTemplate) obj;
            return mMatchRule == other.mMatchRule
                    && Objects.equal(mSubscriberId, other.mSubscriberId)
                    && Objects.equal(mNetworkId, other.mNetworkId);
                    && Objects.equals(mSubscriberId, other.mSubscriberId)
                    && Objects.equals(mNetworkId, other.mNetworkId);
        }
        return false;
    }
@@ -235,7 +236,7 @@ public class NetworkTemplate implements Parcelable {
            return true;
        } else {
            return ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType))
                    && Objects.equal(mSubscriberId, ident.mSubscriberId));
                    && Objects.equals(mSubscriberId, ident.mSubscriberId));
        }
    }

@@ -280,7 +281,7 @@ public class NetworkTemplate implements Parcelable {
    private boolean matchesWifi(NetworkIdentity ident) {
        switch (ident.mType) {
            case TYPE_WIFI:
                return Objects.equal(
                return Objects.equals(
                        removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
            default:
                return false;
Loading