* commit '62d509d24f91959b75219edd0ab1a6f22b82c600': Use java.util.Objects instead on internal API
This commit is contained in:
@@ -93,7 +93,6 @@ import com.android.internal.os.BinderInternal;
|
|||||||
import com.android.internal.os.RuntimeInit;
|
import com.android.internal.os.RuntimeInit;
|
||||||
import com.android.internal.os.SamplingProfilerIntegration;
|
import com.android.internal.os.SamplingProfilerIntegration;
|
||||||
import com.android.internal.util.FastPrintWriter;
|
import com.android.internal.util.FastPrintWriter;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.android.org.conscrypt.OpenSSLSocketImpl;
|
import com.android.org.conscrypt.OpenSSLSocketImpl;
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
|
|
||||||
@@ -109,6 +108,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ public final class ActivityThread {
|
|||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof ProviderKey) {
|
if (o instanceof ProviderKey) {
|
||||||
final ProviderKey other = (ProviderKey) o;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import android.net.wifi.WifiManager;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Network definition that includes strong identity. Analogous to combining
|
* Network definition that includes strong identity. Analogous to combining
|
||||||
@@ -60,7 +60,7 @@ public class NetworkIdentity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(mType, mSubType, mSubscriberId, mNetworkId, mRoaming);
|
return Objects.hash(mType, mSubType, mSubscriberId, mNetworkId, mRoaming);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -68,8 +68,8 @@ public class NetworkIdentity {
|
|||||||
if (obj instanceof NetworkIdentity) {
|
if (obj instanceof NetworkIdentity) {
|
||||||
final NetworkIdentity ident = (NetworkIdentity) obj;
|
final NetworkIdentity ident = (NetworkIdentity) obj;
|
||||||
return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming
|
return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming
|
||||||
&& Objects.equal(mSubscriberId, ident.mSubscriberId)
|
&& Objects.equals(mSubscriberId, ident.mSubscriberId)
|
||||||
&& Objects.equal(mNetworkId, ident.mNetworkId);
|
&& Objects.equals(mNetworkId, ident.mNetworkId);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import static com.android.internal.util.Preconditions.checkNotNull;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Policy for networks matching a {@link NetworkTemplate}, including usage cycle
|
* Policy for networks matching a {@link NetworkTemplate}, including usage cycle
|
||||||
@@ -146,7 +146,7 @@ public class NetworkPolicy implements Parcelable, Comparable<NetworkPolicy> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(template, cycleDay, cycleTimezone, warningBytes, limitBytes,
|
return Objects.hash(template, cycleDay, cycleTimezone, warningBytes, limitBytes,
|
||||||
lastWarningSnooze, lastLimitSnooze, metered, inferred);
|
lastWarningSnooze, lastLimitSnooze, metered, inferred);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,8 +159,8 @@ public class NetworkPolicy implements Parcelable, Comparable<NetworkPolicy> {
|
|||||||
&& lastWarningSnooze == other.lastWarningSnooze
|
&& lastWarningSnooze == other.lastWarningSnooze
|
||||||
&& lastLimitSnooze == other.lastLimitSnooze && metered == other.metered
|
&& lastLimitSnooze == other.lastLimitSnooze && metered == other.metered
|
||||||
&& inferred == other.inferred
|
&& inferred == other.inferred
|
||||||
&& Objects.equal(cycleTimezone, other.cycleTimezone)
|
&& Objects.equals(cycleTimezone, other.cycleTimezone)
|
||||||
&& Objects.equal(template, other.template);
|
&& Objects.equals(template, other.template);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ import android.util.SparseBooleanArray;
|
|||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
|
|
||||||
import java.io.CharArrayWriter;
|
import java.io.CharArrayWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collection of active network statistics. Can contain summary details across
|
* 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) {
|
public int findIndex(String iface, int uid, int set, int tag) {
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[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;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ public class NetworkStats implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[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;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ import android.content.res.Resources;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Template definition used to generically match {@link NetworkIdentity},
|
* Template definition used to generically match {@link NetworkIdentity},
|
||||||
@@ -176,7 +177,7 @@ public class NetworkTemplate implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(mMatchRule, mSubscriberId, mNetworkId);
|
return Objects.hash(mMatchRule, mSubscriberId, mNetworkId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -184,8 +185,8 @@ public class NetworkTemplate implements Parcelable {
|
|||||||
if (obj instanceof NetworkTemplate) {
|
if (obj instanceof NetworkTemplate) {
|
||||||
final NetworkTemplate other = (NetworkTemplate) obj;
|
final NetworkTemplate other = (NetworkTemplate) obj;
|
||||||
return mMatchRule == other.mMatchRule
|
return mMatchRule == other.mMatchRule
|
||||||
&& Objects.equal(mSubscriberId, other.mSubscriberId)
|
&& Objects.equals(mSubscriberId, other.mSubscriberId)
|
||||||
&& Objects.equal(mNetworkId, other.mNetworkId);
|
&& Objects.equals(mNetworkId, other.mNetworkId);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -235,7 +236,7 @@ public class NetworkTemplate implements Parcelable {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType))
|
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) {
|
private boolean matchesWifi(NetworkIdentity ident) {
|
||||||
switch (ident.mType) {
|
switch (ident.mType) {
|
||||||
case TYPE_WIFI:
|
case TYPE_WIFI:
|
||||||
return Objects.equal(
|
return Objects.equals(
|
||||||
removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
|
removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package android.view;
|
|||||||
import android.content.res.CompatibilityInfo;
|
import android.content.res.CompatibilityInfo;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public class DisplayAdjustments {
|
public class DisplayAdjustments {
|
||||||
@@ -91,7 +91,7 @@ public class DisplayAdjustments {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DisplayAdjustments daj = (DisplayAdjustments)o;
|
DisplayAdjustments daj = (DisplayAdjustments)o;
|
||||||
return Objects.equal(daj.mCompatInfo, mCompatInfo) &&
|
return Objects.equals(daj.mCompatInfo, mCompatInfo) &&
|
||||||
Objects.equal(daj.mActivityToken, mActivityToken);
|
Objects.equals(daj.mActivityToken, mActivityToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2007 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.internal.util;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Object utility methods.
|
|
||||||
*/
|
|
||||||
public class Objects {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines whether two possibly-null objects are equal. Returns:
|
|
||||||
*
|
|
||||||
* <ul>
|
|
||||||
* <li>{@code true} if {@code a} and {@code b} are both null.
|
|
||||||
* <li>{@code true} if {@code a} and {@code b} are both non-null and they are
|
|
||||||
* equal according to {@link Object#equals(Object)}.
|
|
||||||
* <li>{@code false} in all other situations.
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* <p>This assumes that any non-null objects passed to this function conform
|
|
||||||
* to the {@code equals()} contract.
|
|
||||||
*/
|
|
||||||
public static boolean equal(Object a, Object b) {
|
|
||||||
return a == b || (a != null && a.equals(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a hash code for multiple values. The hash code is generated by
|
|
||||||
* calling {@link Arrays#hashCode(Object[])}.
|
|
||||||
*
|
|
||||||
* <p>This is useful for implementing {@link Object#hashCode()}. For example,
|
|
||||||
* in an object that has three properties, {@code x}, {@code y}, and
|
|
||||||
* {@code z}, one could write:
|
|
||||||
* <pre>
|
|
||||||
* public int hashCode() {
|
|
||||||
* return Objects.hashCode(getX(), getY(), getZ());
|
|
||||||
* }</pre>
|
|
||||||
*
|
|
||||||
* <b>Warning</b>: When a single object is supplied, the returned hash code
|
|
||||||
* does not equal the hash code of that object.
|
|
||||||
*/
|
|
||||||
public static int hashCode(Object... objects) {
|
|
||||||
return Arrays.hashCode(objects);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package android.media;
|
package android.media;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.ActivityThread;
|
import android.app.ActivityThread;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@@ -43,6 +41,7 @@ import android.view.Display;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -493,11 +492,11 @@ public class MediaRouter {
|
|||||||
boolean volumeChanged = false;
|
boolean volumeChanged = false;
|
||||||
boolean presentationDisplayChanged = false;
|
boolean presentationDisplayChanged = false;
|
||||||
|
|
||||||
if (!Objects.equal(route.mName, globalRoute.name)) {
|
if (!Objects.equals(route.mName, globalRoute.name)) {
|
||||||
route.mName = globalRoute.name;
|
route.mName = globalRoute.name;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equal(route.mDescription, globalRoute.description)) {
|
if (!Objects.equals(route.mDescription, globalRoute.description)) {
|
||||||
route.mDescription = globalRoute.description;
|
route.mDescription = globalRoute.description;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
|
|
||||||
package com.android.media.remotedisplay;
|
package com.android.media.remotedisplay;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
|
|
||||||
import android.media.MediaRouter;
|
import android.media.MediaRouter;
|
||||||
import android.media.RemoteDisplayState.RemoteDisplayInfo;
|
import android.media.RemoteDisplayState.RemoteDisplayInfo;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a remote display that has been discovered.
|
* Represents a remote display that has been discovered.
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +87,7 @@ public class RemoteDisplay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
if (!Objects.equal(mMutableInfo.name, name)) {
|
if (!Objects.equals(mMutableInfo.name, name)) {
|
||||||
mMutableInfo.name = name;
|
mMutableInfo.name = name;
|
||||||
mImmutableInfo = null;
|
mImmutableInfo = null;
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ public class RemoteDisplay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
if (!Objects.equal(mMutableInfo.description, description)) {
|
if (!Objects.equals(mMutableInfo.description, description)) {
|
||||||
mMutableInfo.description = description;
|
mMutableInfo.description = description;
|
||||||
mImmutableInfo = null;
|
mImmutableInfo = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.android.documentsui.DocumentsActivity.State;
|
|||||||
import com.android.documentsui.model.RootInfo;
|
import com.android.documentsui.model.RootInfo;
|
||||||
import com.android.internal.annotations.GuardedBy;
|
import com.android.internal.annotations.GuardedBy;
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
import com.google.android.collect.Sets;
|
import com.google.android.collect.Sets;
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
@@ -51,6 +50,7 @@ import libcore.io.IoUtils;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ public class RootsCache {
|
|||||||
|
|
||||||
private RootInfo getRootLocked(String authority, String rootId) {
|
private RootInfo getRootLocked(String authority, String rootId) {
|
||||||
for (RootInfo root : mRoots.get(authority)) {
|
for (RootInfo root : mRoots.get(authority)) {
|
||||||
if (Objects.equal(root.rootId, rootId)) {
|
if (Objects.equals(root.rootId, rootId)) {
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ public class RootsCache {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
final int rootIcon = root.derivedIcon != 0 ? root.derivedIcon : root.icon;
|
final int rootIcon = root.derivedIcon != 0 ? root.derivedIcon : root.icon;
|
||||||
for (RootInfo test : mRoots.get(root.authority)) {
|
for (RootInfo test : mRoots.get(root.authority)) {
|
||||||
if (Objects.equal(test.rootId, root.rootId)) {
|
if (Objects.equals(test.rootId, root.rootId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final int testIcon = test.derivedIcon != 0 ? test.derivedIcon : test.icon;
|
final int testIcon = test.derivedIcon != 0 ? test.derivedIcon : test.icon;
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ import android.widget.TextView;
|
|||||||
import com.android.documentsui.DocumentsActivity.State;
|
import com.android.documentsui.DocumentsActivity.State;
|
||||||
import com.android.documentsui.model.DocumentInfo;
|
import com.android.documentsui.model.DocumentInfo;
|
||||||
import com.android.documentsui.model.RootInfo;
|
import com.android.documentsui.model.RootInfo;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display list of known storage backend roots.
|
* Display list of known storage backend roots.
|
||||||
@@ -157,7 +157,7 @@ public class RootsFragment extends Fragment {
|
|||||||
final Object item = mAdapter.getItem(i);
|
final Object item = mAdapter.getItem(i);
|
||||||
if (item instanceof RootItem) {
|
if (item instanceof RootItem) {
|
||||||
final RootInfo testRoot = ((RootItem) item).root;
|
final RootInfo testRoot = ((RootItem) item).root;
|
||||||
if (Objects.equal(testRoot, root)) {
|
if (Objects.equals(testRoot, root)) {
|
||||||
mList.setItemChecked(i, true);
|
mList.setItemChecked(i, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1428,7 +1428,6 @@ com.android.internal.util.AsyncChannel
|
|||||||
com.android.internal.util.AsyncChannel$DeathMonitor
|
com.android.internal.util.AsyncChannel$DeathMonitor
|
||||||
com.android.internal.util.FastXmlSerializer
|
com.android.internal.util.FastXmlSerializer
|
||||||
com.android.internal.util.MemInfoReader
|
com.android.internal.util.MemInfoReader
|
||||||
com.android.internal.util.Objects
|
|
||||||
com.android.internal.util.Preconditions
|
com.android.internal.util.Preconditions
|
||||||
com.android.internal.util.XmlUtils
|
com.android.internal.util.XmlUtils
|
||||||
com.android.internal.view.ActionBarPolicy
|
com.android.internal.view.ActionBarPolicy
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import static com.android.server.am.ActivityStackSupervisor.DEBUG_STATES;
|
|||||||
import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID;
|
import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID;
|
||||||
|
|
||||||
import com.android.internal.os.BatteryStatsImpl;
|
import com.android.internal.os.BatteryStatsImpl;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.android.server.Watchdog;
|
import com.android.server.Watchdog;
|
||||||
import com.android.server.am.ActivityManagerService.ItemMatcher;
|
import com.android.server.am.ActivityManagerService.ItemMatcher;
|
||||||
import com.android.server.wm.AppTransition;
|
import com.android.server.wm.AppTransition;
|
||||||
@@ -82,6 +81,7 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State and management of a single stack of activities.
|
* State and management of a single stack of activities.
|
||||||
@@ -2359,7 +2359,7 @@ final class ActivityStack {
|
|||||||
ArrayList<ActivityRecord> activities = r.task.mActivities;
|
ArrayList<ActivityRecord> activities = r.task.mActivities;
|
||||||
for (int index = activities.indexOf(r); index >= 0; --index) {
|
for (int index = activities.indexOf(r); index >= 0; --index) {
|
||||||
ActivityRecord cur = activities.get(index);
|
ActivityRecord cur = activities.get(index);
|
||||||
if (!Objects.equal(cur.taskAffinity, r.taskAffinity)) {
|
if (!Objects.equals(cur.taskAffinity, r.taskAffinity)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
finishActivityLocked(cur, Activity.RESULT_CANCELED, null, "request-affinity", true);
|
finishActivityLocked(cur, Activity.RESULT_CANCELED, null, "request-affinity", true);
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.media;
|
package com.android.server.media;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.android.server.Watchdog;
|
import com.android.server.Watchdog;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
@@ -52,6 +51,7 @@ import java.io.PrintWriter;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a mechanism for discovering media routes and manages media playback
|
* Provides a mechanism for discovering media routes and manages media playback
|
||||||
@@ -384,7 +384,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub
|
|||||||
ClientRecord clientRecord = mAllClientRecords.get(client.asBinder());
|
ClientRecord clientRecord = mAllClientRecords.get(client.asBinder());
|
||||||
if (clientRecord != null) {
|
if (clientRecord != null) {
|
||||||
final String oldRouteId = clientRecord.mSelectedRouteId;
|
final String oldRouteId = clientRecord.mSelectedRouteId;
|
||||||
if (!Objects.equal(routeId, oldRouteId)) {
|
if (!Objects.equals(routeId, oldRouteId)) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Slog.d(TAG, clientRecord + ": Set selected route, routeId=" + routeId
|
Slog.d(TAG, clientRecord + ": Set selected route, routeId=" + routeId
|
||||||
+ ", oldRouteId=" + oldRouteId
|
+ ", oldRouteId=" + oldRouteId
|
||||||
@@ -1257,12 +1257,12 @@ public final class MediaRouterService extends IMediaRouterService.Stub
|
|||||||
mDescriptor = descriptor;
|
mDescriptor = descriptor;
|
||||||
if (descriptor != null) {
|
if (descriptor != null) {
|
||||||
final String name = computeName(descriptor);
|
final String name = computeName(descriptor);
|
||||||
if (!Objects.equal(mMutableInfo.name, name)) {
|
if (!Objects.equals(mMutableInfo.name, name)) {
|
||||||
mMutableInfo.name = name;
|
mMutableInfo.name = name;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
final String description = computeDescription(descriptor);
|
final String description = computeDescription(descriptor);
|
||||||
if (!Objects.equal(mMutableInfo.description, description)) {
|
if (!Objects.equals(mMutableInfo.description, description)) {
|
||||||
mMutableInfo.description = description;
|
mMutableInfo.description = description;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.media;
|
package com.android.server.media;
|
||||||
|
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -35,6 +33,7 @@ import android.util.Slog;
|
|||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maintains a connection to a particular remote display provider service.
|
* Maintains a connection to a particular remote display provider service.
|
||||||
@@ -101,7 +100,7 @@ final class RemoteDisplayProviderProxy implements ServiceConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setSelectedDisplay(String id) {
|
public void setSelectedDisplay(String id) {
|
||||||
if (!Objects.equal(mSelectedDisplayId, id)) {
|
if (!Objects.equals(mSelectedDisplayId, id)) {
|
||||||
if (mConnectionReady && mSelectedDisplayId != null) {
|
if (mConnectionReady && mSelectedDisplayId != null) {
|
||||||
mActiveConnection.disconnect(mSelectedDisplayId);
|
mActiveConnection.disconnect(mSelectedDisplayId);
|
||||||
}
|
}
|
||||||
@@ -293,7 +292,7 @@ final class RemoteDisplayProviderProxy implements ServiceConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setDisplayState(RemoteDisplayState state) {
|
private void setDisplayState(RemoteDisplayState state) {
|
||||||
if (!Objects.equal(mDisplayState, state)) {
|
if (!Objects.equals(mDisplayState, state)) {
|
||||||
mDisplayState = state;
|
mDisplayState = state;
|
||||||
if (!mScheduledDisplayStateChangedCallback) {
|
if (!mScheduledDisplayStateChangedCallback) {
|
||||||
mScheduledDisplayStateChangedCallback = true;
|
mScheduledDisplayStateChangedCallback = true;
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ import com.android.internal.R;
|
|||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.FastXmlSerializer;
|
import com.android.internal.util.FastXmlSerializer;
|
||||||
import com.android.internal.util.IndentingPrintWriter;
|
import com.android.internal.util.IndentingPrintWriter;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
import com.google.android.collect.Maps;
|
import com.google.android.collect.Maps;
|
||||||
import com.google.android.collect.Sets;
|
import com.google.android.collect.Sets;
|
||||||
@@ -155,6 +154,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
|
|
||||||
@@ -688,7 +688,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
|||||||
// mobile templates are relevant when SIM is ready and
|
// mobile templates are relevant when SIM is ready and
|
||||||
// subscriberId matches.
|
// subscriberId matches.
|
||||||
if (tele.getSimState() == SIM_STATE_READY) {
|
if (tele.getSimState() == SIM_STATE_READY) {
|
||||||
return Objects.equal(tele.getSubscriberId(), template.getSubscriberId());
|
return Objects.equals(tele.getSubscriberId(), template.getSubscriberId());
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -946,7 +946,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
|||||||
// TODO: offer more granular control over radio states once
|
// TODO: offer more granular control over radio states once
|
||||||
// 4965893 is available.
|
// 4965893 is available.
|
||||||
if (tele.getSimState() == SIM_STATE_READY
|
if (tele.getSimState() == SIM_STATE_READY
|
||||||
&& Objects.equal(tele.getSubscriberId(), template.getSubscriberId())) {
|
&& Objects.equals(tele.getSubscriberId(), template.getSubscriberId())) {
|
||||||
setPolicyDataEnable(TYPE_MOBILE, enabled);
|
setPolicyDataEnable(TYPE_MOBILE, enabled);
|
||||||
setPolicyDataEnable(TYPE_WIMAX, enabled);
|
setPolicyDataEnable(TYPE_WIMAX, enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import android.util.AtomicFile;
|
|||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.internal.util.FileRotator;
|
import com.android.internal.util.FileRotator;
|
||||||
import com.android.internal.util.IndentingPrintWriter;
|
import com.android.internal.util.IndentingPrintWriter;
|
||||||
import com.android.internal.util.Objects;
|
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
import com.google.android.collect.Maps;
|
import com.google.android.collect.Maps;
|
||||||
|
|
||||||
@@ -50,6 +49,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
|
|||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
this.set = set;
|
this.set = set;
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
hashCode = Objects.hashCode(ident, uid, set, tag);
|
hashCode = Objects.hash(ident, uid, set, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -521,7 +521,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
|
|||||||
if (obj instanceof Key) {
|
if (obj instanceof Key) {
|
||||||
final Key key = (Key) obj;
|
final Key key = (Key) obj;
|
||||||
return uid == key.uid && set == key.set && tag == key.tag
|
return uid == key.uid && set == key.set && tag == key.tag
|
||||||
&& Objects.equal(ident, key.ident);
|
&& Objects.equals(ident, key.ident);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user