Merge "Remove uses of libcore.util.Objects.hashCode / equals."
This commit is contained in:
committed by
Android (Google) Code Review
commit
81945916f1
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -30,7 +30,7 @@ import android.view.RemotableViewMethod;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* An ImageView for displaying an Icon. Avoids reloading the Icon when possible.
|
||||
@@ -126,7 +126,7 @@ public class CachingIconView extends ImageView {
|
||||
|
||||
boolean isCached = mLastResId != 0
|
||||
&& icon.getResId() == mLastResId
|
||||
&& Objects.equal(iconPackage, mLastPackage);
|
||||
&& Objects.equals(iconPackage, mLastPackage);
|
||||
|
||||
mLastPackage = iconPackage;
|
||||
mLastResId = icon.getResId();
|
||||
|
||||
@@ -51,7 +51,6 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.server.LocalServices;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.Objects;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
@@ -66,6 +65,7 @@ import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -996,7 +996,7 @@ final class SettingsState {
|
||||
String defaultValue = this.defaultValue;
|
||||
boolean defaultFromSystem = this.defaultFromSystem;
|
||||
if (setDefault) {
|
||||
if (!Objects.equal(value, this.defaultValue)
|
||||
if (!Objects.equals(value, this.defaultValue)
|
||||
&& (!defaultFromSystem || callerSystem)) {
|
||||
defaultValue = value;
|
||||
// Default null means no default, so the tag is irrelevant
|
||||
@@ -1015,10 +1015,10 @@ final class SettingsState {
|
||||
}
|
||||
|
||||
// Is something gonna change?
|
||||
if (Objects.equal(value, this.value)
|
||||
&& Objects.equal(defaultValue, this.defaultValue)
|
||||
&& Objects.equal(packageName, this.packageName)
|
||||
&& Objects.equal(tag, this.tag)
|
||||
if (Objects.equals(value, this.value)
|
||||
&& Objects.equals(defaultValue, this.defaultValue)
|
||||
&& Objects.equals(packageName, this.packageName)
|
||||
&& Objects.equals(tag, this.tag)
|
||||
&& defaultFromSystem == this.defaultFromSystem) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.widget.TextView;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.qs.QSIconView;
|
||||
import com.android.systemui.qs.tileimpl.QSTileView;
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CustomizeTileView extends QSTileView {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CustomizeTileView extends QSTileView {
|
||||
}
|
||||
|
||||
public void setAppLabel(CharSequence label) {
|
||||
if (!Objects.equal(label, mAppLabel.getText())) {
|
||||
if (!Objects.equals(label, mAppLabel.getText())) {
|
||||
mAppLabel.setText(label);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ import com.android.systemui.plugins.qs.QSTile.State;
|
||||
import com.android.systemui.qs.tileimpl.QSTileImpl;
|
||||
import com.android.systemui.qs.external.TileLifecycleManager.TileChangeListener;
|
||||
import com.android.systemui.qs.QSTileHost;
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG;
|
||||
@@ -140,7 +140,7 @@ public class CustomTile extends QSTileImpl<State> implements TileChangeListener
|
||||
if (icon1.getResId() != icon2.getResId()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equal(icon1.getResPackage(), icon2.getResPackage())) {
|
||||
if (!Objects.equals(icon1.getResPackage(), icon2.getResPackage())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -39,8 +39,7 @@ import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
import com.android.systemui.qs.external.PackageManagerAdapter;
|
||||
|
||||
import libcore.util.Objects;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -307,7 +306,7 @@ public class TileLifecycleManager extends BroadcastReceiver implements
|
||||
if (!Intent.ACTION_USER_UNLOCKED.equals(intent.getAction())) {
|
||||
Uri data = intent.getData();
|
||||
String pkgName = data.getEncodedSchemeSpecificPart();
|
||||
if (!Objects.equal(pkgName, mIntent.getComponent().getPackageName())) {
|
||||
if (!Objects.equals(pkgName, mIntent.getComponent().getPackageName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,7 @@ import com.android.systemui.qs.customize.TileQueryHelper.TileStateListener;
|
||||
import com.android.systemui.qs.external.TileLifecycleManager.TileChangeListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Manages the priority which lets {@link TileServices} make decisions about which tiles
|
||||
@@ -248,7 +247,7 @@ public class TileServiceManager {
|
||||
Uri data = intent.getData();
|
||||
String pkgName = data.getEncodedSchemeSpecificPart();
|
||||
final ComponentName component = mStateManager.getComponent();
|
||||
if (!Objects.equal(pkgName, component.getPackageName())) {
|
||||
if (!Objects.equals(pkgName, component.getPackageName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,8 +259,8 @@ public class TileServiceManager {
|
||||
List<ResolveInfo> services = pm.queryIntentServicesAsUser(
|
||||
queryIntent, 0, ActivityManager.getCurrentUser());
|
||||
for (ResolveInfo info : services) {
|
||||
if (Objects.equal(info.serviceInfo.packageName, component.getPackageName())
|
||||
&& Objects.equal(info.serviceInfo.name, component.getClassName())) {
|
||||
if (Objects.equals(info.serviceInfo.packageName, component.getPackageName())
|
||||
&& Objects.equals(info.serviceInfo.name, component.getClassName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.qs.QSIconView;
|
||||
import com.android.systemui.plugins.qs.QSTile;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/** View that represents a standard quick settings tile. **/
|
||||
public class QSTileView extends QSTileBaseView {
|
||||
@@ -98,7 +98,7 @@ public class QSTileView extends QSTileBaseView {
|
||||
@Override
|
||||
protected void handleStateChanged(QSTile.State state) {
|
||||
super.handleStateChanged(state);
|
||||
if (!Objects.equal(mLabel.getText(), state.label) || mState != state.state) {
|
||||
if (!Objects.equals(mLabel.getText(), state.label) || mState != state.state) {
|
||||
if (state.state == Tile.STATE_UNAVAILABLE) {
|
||||
int color = QSTileImpl.getColorForState(getContext(), state.state);
|
||||
state.label = new SpannableStringBuilder().append(state.label,
|
||||
@@ -108,7 +108,7 @@ public class QSTileView extends QSTileBaseView {
|
||||
mState = state.state;
|
||||
mLabel.setText(state.label);
|
||||
}
|
||||
if (!Objects.equal(mSecondLine.getText(), state.secondaryLabel)) {
|
||||
if (!Objects.equals(mSecondLine.getText(), state.secondaryLabel)) {
|
||||
mSecondLine.setText(state.secondaryLabel);
|
||||
mSecondLine.setVisibility(TextUtils.isEmpty(state.secondaryLabel) ? View.GONE
|
||||
: View.VISIBLE);
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.android.settingslib.Utils;
|
||||
import com.android.systemui.fragments.FragmentHostManager;
|
||||
import com.android.systemui.R;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RadioListPreference extends CustomListPreference {
|
||||
|
||||
@@ -124,7 +124,7 @@ public class RadioListPreference extends CustomListPreference {
|
||||
SelectablePreference pref = new SelectablePreference(context);
|
||||
getPreferenceScreen().addPreference(pref);
|
||||
pref.setTitle(entry);
|
||||
pref.setChecked(Objects.equal(current, values[i]));
|
||||
pref.setChecked(Objects.equals(current, values[i]));
|
||||
pref.setKey(String.valueOf(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,11 @@ import com.android.internal.R;
|
||||
import com.android.server.UiThread;
|
||||
import com.android.server.autofill.Helper;
|
||||
|
||||
import libcore.util.Objects;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -356,7 +355,7 @@ final class FillUi {
|
||||
filterText = filterText.toLowerCase();
|
||||
}
|
||||
|
||||
if (Objects.equal(mFilterText, filterText)) {
|
||||
if (Objects.equals(mFilterText, filterText)) {
|
||||
return;
|
||||
}
|
||||
mFilterText = filterText;
|
||||
|
||||
@@ -23,8 +23,7 @@ import android.view.DisplayCutout;
|
||||
import android.view.Surface;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Describes the characteristics of a physical display device.
|
||||
@@ -312,28 +311,28 @@ final class DisplayDeviceInfo {
|
||||
if (colorMode != other.colorMode) {
|
||||
diff |= DIFF_COLOR_MODE;
|
||||
}
|
||||
if (!Objects.equal(name, other.name)
|
||||
|| !Objects.equal(uniqueId, other.uniqueId)
|
||||
if (!Objects.equals(name, other.name)
|
||||
|| !Objects.equals(uniqueId, other.uniqueId)
|
||||
|| width != other.width
|
||||
|| height != other.height
|
||||
|| modeId != other.modeId
|
||||
|| defaultModeId != other.defaultModeId
|
||||
|| !Arrays.equals(supportedModes, other.supportedModes)
|
||||
|| !Arrays.equals(supportedColorModes, other.supportedColorModes)
|
||||
|| !Objects.equal(hdrCapabilities, other.hdrCapabilities)
|
||||
|| !Objects.equals(hdrCapabilities, other.hdrCapabilities)
|
||||
|| densityDpi != other.densityDpi
|
||||
|| xDpi != other.xDpi
|
||||
|| yDpi != other.yDpi
|
||||
|| appVsyncOffsetNanos != other.appVsyncOffsetNanos
|
||||
|| presentationDeadlineNanos != other.presentationDeadlineNanos
|
||||
|| flags != other.flags
|
||||
|| !Objects.equal(displayCutout, other.displayCutout)
|
||||
|| !Objects.equals(displayCutout, other.displayCutout)
|
||||
|| touch != other.touch
|
||||
|| rotation != other.rotation
|
||||
|| type != other.type
|
||||
|| !Objects.equal(address, other.address)
|
||||
|| !Objects.equals(address, other.address)
|
||||
|| ownerUid != other.ownerUid
|
||||
|| !Objects.equal(ownerPackageName, other.ownerPackageName)) {
|
||||
|| !Objects.equals(ownerPackageName, other.ownerPackageName)) {
|
||||
diff |= DIFF_OTHER;
|
||||
}
|
||||
return diff;
|
||||
|
||||
@@ -25,8 +25,7 @@ import android.view.Surface;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Describes how a logical display is configured.
|
||||
@@ -225,7 +224,7 @@ final class LogicalDisplay {
|
||||
// logical display that they are sharing. (eg. Adjust size for pixel-perfect
|
||||
// mirroring over HDMI.)
|
||||
DisplayDeviceInfo deviceInfo = mPrimaryDisplayDevice.getDisplayDeviceInfoLocked();
|
||||
if (!Objects.equal(mPrimaryDisplayDeviceInfo, deviceInfo)) {
|
||||
if (!Objects.equals(mPrimaryDisplayDeviceInfo, deviceInfo)) {
|
||||
mBaseDisplayInfo.layerStack = mLayerStack;
|
||||
mBaseDisplayInfo.flags = 0;
|
||||
if ((deviceInfo.flags & DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) {
|
||||
|
||||
@@ -52,9 +52,9 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.Objects;
|
||||
|
||||
/**
|
||||
* Manages persistent state recorded by the display manager service as an XML file.
|
||||
@@ -180,7 +180,7 @@ final class PersistentDataStore {
|
||||
if (index >= 0) {
|
||||
alias = mRememberedWifiDisplays.get(index).getDeviceAlias();
|
||||
}
|
||||
if (!Objects.equal(display.getDeviceAlias(), alias)) {
|
||||
if (!Objects.equals(display.getDeviceAlias(), alias)) {
|
||||
return new WifiDisplay(display.getDeviceAddress(), display.getDeviceName(),
|
||||
alias, display.isAvailable(), display.canConnect(), display.isRemembered());
|
||||
}
|
||||
|
||||
@@ -39,11 +39,10 @@ import android.view.Surface;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Connects to Wifi displays that implement the Miracast protocol.
|
||||
@@ -248,7 +247,7 @@ final class WifiDisplayAdapter extends DisplayAdapter {
|
||||
}
|
||||
|
||||
WifiDisplay display = mPersistentDataStore.getRememberedWifiDisplay(address);
|
||||
if (display != null && !Objects.equal(display.getDeviceAlias(), alias)) {
|
||||
if (display != null && !Objects.equals(display.getDeviceAlias(), alias)) {
|
||||
display = new WifiDisplay(address, display.getDeviceName(), alias,
|
||||
false, false, false);
|
||||
if (mPersistentDataStore.rememberWifiDisplay(display)) {
|
||||
|
||||
@@ -53,8 +53,7 @@ import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Manages all of the various asynchronous interactions with the {@link WifiP2pManager}
|
||||
@@ -944,7 +943,7 @@ final class WifiDisplayController implements DumpUtils.Dump {
|
||||
|
||||
private void advertiseDisplay(final WifiDisplay display,
|
||||
final Surface surface, final int width, final int height, final int flags) {
|
||||
if (!Objects.equal(mAdvertisedDisplay, display)
|
||||
if (!Objects.equals(mAdvertisedDisplay, display)
|
||||
|| mAdvertisedDisplaySurface != surface
|
||||
|| mAdvertisedDisplayWidth != width
|
||||
|| mAdvertisedDisplayHeight != height
|
||||
|
||||
@@ -58,8 +58,7 @@ import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import libcore.util.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Service api for managing dreams.
|
||||
@@ -349,7 +348,7 @@ public final class DreamManagerService extends SystemService {
|
||||
|
||||
private void startDreamLocked(final ComponentName name,
|
||||
final boolean isTest, final boolean canDoze, final int userId) {
|
||||
if (Objects.equal(mCurrentDreamName, name)
|
||||
if (Objects.equals(mCurrentDreamName, name)
|
||||
&& mCurrentDreamIsTest == isTest
|
||||
&& mCurrentDreamCanDoze == canDoze
|
||||
&& mCurrentDreamUserId == userId) {
|
||||
|
||||
@@ -116,10 +116,10 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.io.Streams;
|
||||
import libcore.util.Objects;
|
||||
|
||||
/*
|
||||
* Wraps the C++ InputManager and provides its callbacks.
|
||||
@@ -1462,7 +1462,7 @@ public class InputManagerService extends IInputManager.Stub
|
||||
oldLayout = mDataStore.getCurrentKeyboardLayout(identifier.getDescriptor());
|
||||
}
|
||||
if (mDataStore.addKeyboardLayout(key, keyboardLayoutDescriptor)
|
||||
&& !Objects.equal(oldLayout, mDataStore.getCurrentKeyboardLayout(key))) {
|
||||
&& !Objects.equals(oldLayout, mDataStore.getCurrentKeyboardLayout(key))) {
|
||||
mHandler.sendEmptyMessage(MSG_RELOAD_KEYBOARD_LAYOUTS);
|
||||
}
|
||||
} finally {
|
||||
@@ -1495,7 +1495,7 @@ public class InputManagerService extends IInputManager.Stub
|
||||
removed |= mDataStore.removeKeyboardLayout(identifier.getDescriptor(),
|
||||
keyboardLayoutDescriptor);
|
||||
}
|
||||
if (removed && !Objects.equal(oldLayout,
|
||||
if (removed && !Objects.equals(oldLayout,
|
||||
mDataStore.getCurrentKeyboardLayout(key))) {
|
||||
mHandler.sendEmptyMessage(MSG_RELOAD_KEYBOARD_LAYOUTS);
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.Objects;
|
||||
|
||||
/**
|
||||
* Manages persistent state recorded by the input manager service as an XML file.
|
||||
@@ -377,7 +377,7 @@ final class PersistentDataStore {
|
||||
}
|
||||
|
||||
public boolean setCurrentKeyboardLayout(String keyboardLayout) {
|
||||
if (Objects.equal(mCurrentKeyboardLayout, keyboardLayout)) {
|
||||
if (Objects.equals(mCurrentKeyboardLayout, keyboardLayout)) {
|
||||
return false;
|
||||
}
|
||||
addKeyboardLayout(keyboardLayout);
|
||||
@@ -432,7 +432,7 @@ final class PersistentDataStore {
|
||||
|
||||
private void updateCurrentKeyboardLayoutIfRemoved(
|
||||
String removedKeyboardLayout, int removedIndex) {
|
||||
if (Objects.equal(mCurrentKeyboardLayout, removedKeyboardLayout)) {
|
||||
if (Objects.equals(mCurrentKeyboardLayout, removedKeyboardLayout)) {
|
||||
if (!mUnassociatedKeyboardLayouts.isEmpty()) {
|
||||
int index = removedIndex;
|
||||
if (index == mUnassociatedKeyboardLayouts.size()) {
|
||||
|
||||
@@ -35,13 +35,12 @@ import android.util.ArrayMap;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Slog;
|
||||
|
||||
import libcore.util.Objects;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -106,7 +105,7 @@ final class OverlayManagerServiceImpl {
|
||||
final PackageInfo overlayPackage = overlayPackages.get(i);
|
||||
final OverlayInfo oi = storedOverlayInfos.get(overlayPackage.packageName);
|
||||
if (oi == null || !oi.targetPackageName.equals(overlayPackage.overlayTarget)
|
||||
|| !Objects.equal(oi.category, overlayPackage.overlayCategory)) {
|
||||
|| !Objects.equals(oi.category, overlayPackage.overlayCategory)) {
|
||||
// Update the overlay if it didn't exist or had the wrong target package.
|
||||
mSettings.init(overlayPackage.packageName, newUserId,
|
||||
overlayPackage.overlayTarget,
|
||||
@@ -434,7 +433,7 @@ final class OverlayManagerServiceImpl {
|
||||
// Don't touch static overlays.
|
||||
continue;
|
||||
}
|
||||
if (withinCategory && !Objects.equal(disabledOverlayPackageInfo.overlayCategory,
|
||||
if (withinCategory && !Objects.equals(disabledOverlayPackageInfo.overlayCategory,
|
||||
oi.category)) {
|
||||
// Don't touch overlays from other categories.
|
||||
continue;
|
||||
|
||||
@@ -32,8 +32,6 @@ import com.android.internal.util.Preconditions;
|
||||
import com.android.server.pm.ShortcutService.DumpFilter;
|
||||
import com.android.server.pm.ShortcutService.InvalidFileFormatException;
|
||||
|
||||
import libcore.util.Objects;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -44,6 +42,7 @@ import org.xmlpull.v1.XmlSerializer;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
@@ -454,7 +453,7 @@ class ShortcutUser {
|
||||
private void setLauncher(ComponentName launcherComponent, boolean allowPurgeLastKnown) {
|
||||
mCachedLauncher = launcherComponent; // Always update the in-memory cache.
|
||||
|
||||
if (Objects.equal(mLastKnownLauncher, launcherComponent)) {
|
||||
if (Objects.equals(mLastKnownLauncher, launcherComponent)) {
|
||||
return;
|
||||
}
|
||||
if (!allowPurgeLastKnown && launcherComponent == null) {
|
||||
|
||||
@@ -101,7 +101,6 @@ import com.android.server.am.UserState;
|
||||
import com.android.server.storage.DeviceStorageMonitorInternal;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.Objects;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
@@ -122,6 +121,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Service for {@link UserManager}.
|
||||
@@ -604,7 +604,7 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
return;
|
||||
}
|
||||
String currentAccount = userData.account;
|
||||
if (!Objects.equal(currentAccount, accountName)) {
|
||||
if (!Objects.equals(currentAccount, accountName)) {
|
||||
userData.account = accountName;
|
||||
userToUpdate = userData;
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import dalvik.system.VMRuntime;
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.Objects;
|
||||
|
||||
/**
|
||||
* Stat file which store usage information about dex files.
|
||||
@@ -830,7 +830,7 @@ public class PackageDexUsage extends AbstractStatsBase<Void> {
|
||||
// We detected an unsupported context.
|
||||
mClassLoaderContext = UNSUPPORTED_CLASS_LOADER_CONTEXT;
|
||||
} else if (!UNSUPPORTED_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext) &&
|
||||
!Objects.equal(mClassLoaderContext, dexUseInfo.mClassLoaderContext)) {
|
||||
!Objects.equals(mClassLoaderContext, dexUseInfo.mClassLoaderContext)) {
|
||||
// We detected a context change.
|
||||
mClassLoaderContext = VARIABLE_CLASS_LOADER_CONTEXT;
|
||||
}
|
||||
@@ -838,7 +838,7 @@ public class PackageDexUsage extends AbstractStatsBase<Void> {
|
||||
return updateIsas ||
|
||||
(oldIsUsedByOtherApps != mIsUsedByOtherApps) ||
|
||||
updateLoadingPackages
|
||||
|| !Objects.equal(oldClassLoaderContext, mClassLoaderContext);
|
||||
|| !Objects.equals(oldClassLoaderContext, mClassLoaderContext);
|
||||
}
|
||||
|
||||
public boolean isUsedByOtherApps() {
|
||||
|
||||
@@ -100,14 +100,13 @@ import com.android.server.lights.LightsManager;
|
||||
import com.android.server.policy.WindowManagerPolicy;
|
||||
import com.android.server.power.batterysaver.BatterySaverController;
|
||||
|
||||
import libcore.util.Objects;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* The power manager service is responsible for coordinating power management
|
||||
@@ -3976,7 +3975,7 @@ public final class PowerManagerService extends SystemService
|
||||
}
|
||||
|
||||
public boolean hasSameWorkSource(WorkSource workSource) {
|
||||
return Objects.equal(mWorkSource, workSource);
|
||||
return Objects.equals(mWorkSource, workSource);
|
||||
}
|
||||
|
||||
public void updateWorkSource(WorkSource workSource) {
|
||||
|
||||
Reference in New Issue
Block a user