Frameworks/base: Use Arrays.toString

Fix a couple of cases where Arrays.toString should be used.

Bug: 19797138
Change-Id: I905fc79e63face9b26975320a92086c732bf6316
This commit is contained in:
Andreas Gampe
2015-12-11 18:00:38 -08:00
parent 3ab0c4c43e
commit e6748ce31f
10 changed files with 19 additions and 13 deletions

View File

@@ -2165,7 +2165,7 @@ public final class BluetoothAdapter {
@Deprecated
@RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
public boolean startLeScan(final UUID[] serviceUuids, final LeScanCallback callback) {
if (DBG) Log.d(TAG, "startLeScan(): " + serviceUuids);
if (DBG) Log.d(TAG, "startLeScan(): " + Arrays.toString(serviceUuids));
if (callback == null) {
if (DBG) Log.e(TAG, "startLeScan: null callback");
return false;

View File

@@ -27,6 +27,7 @@ import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Locale;
import java.util.UUID;
import android.net.LocalSocket;
@@ -234,9 +235,9 @@ public final class BluetoothSocket implements Closeable {
BluetoothSocket as = new BluetoothSocket(this);
as.mSocketState = SocketState.CONNECTED;
FileDescriptor[] fds = mSocket.getAncillaryFileDescriptors();
if (DBG) Log.d(TAG, "socket fd passed by stack fds: " + fds);
if (DBG) Log.d(TAG, "socket fd passed by stack fds: " + Arrays.toString(fds));
if(fds == null || fds.length != 1) {
Log.e(TAG, "socket fd passed from stack failed, fds: " + fds);
Log.e(TAG, "socket fd passed from stack failed, fds: " + Arrays.toString(fds));
as.close();
throw new IOException("bt socket acept failed");
}

View File

@@ -52,6 +52,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
/**
* Content providers are one of the primary building blocks of Android applications, providing
@@ -1854,7 +1855,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
if (mAuthority != null) {
message += mAuthority;
} else {
message += mAuthorities;
message += Arrays.toString(mAuthorities);
}
throw new SecurityException(message);
}

View File

@@ -746,7 +746,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs));
}
if (resourceDirs != null) {
pw.println(prefix + "resourceDirs=" + resourceDirs);
pw.println(prefix + "resourceDirs=" + Arrays.toString(resourceDirs));
}
if ((flags&DUMP_FLAG_DETAILS) != 0 && seinfo != null) {
pw.println(prefix + "seinfo=" + seinfo);

View File

@@ -54,6 +54,7 @@ import android.view.ViewRootImpl;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -2209,7 +2210,7 @@ public final class InputMethodManager {
p.println(" mCurrentTextBoxAttribute: null");
}
p.println(" mServedInputConnection=" + mServedInputConnection);
p.println(" mCompletions=" + mCompletions);
p.println(" mCompletions=" + Arrays.toString(mCompletions));
p.println(" mCursorRect=" + mCursorRect);
p.println(" mCursorSelStart=" + mCursorSelStart
+ " mCursorSelEnd=" + mCursorSelEnd

View File

@@ -17,6 +17,7 @@
package android.drm;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@@ -52,7 +53,7 @@ public class DrmInfo {
if (!isValid()) {
final String msg = "infoType: " + infoType + "," +
"mimeType: " + mimeType + "," +
"data: " + data;
"data: " + Arrays.toString(data);
throw new IllegalArgumentException(msg);
}
@@ -79,7 +80,7 @@ public class DrmInfo {
if (!isValid()) {
final String msg = "infoType: " + infoType + "," +
"mimeType: " + mimeType + "," +
"data: " + mData;
"data: " + Arrays.toString(mData);
throw new IllegalArgumentException();
}

View File

@@ -18,6 +18,7 @@ package android.drm;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
/**
* An entity class that wraps the license information retrieved from the online DRM server.
@@ -103,7 +104,7 @@ public class DrmRights {
mMimeType = mimeType;
if (!isValid()) {
final String msg = "mimeType: " + mMimeType + "," +
"data: " + mData;
"data: " + Arrays.toString(mData);
throw new IllegalArgumentException(msg);
}
}
@@ -127,7 +128,7 @@ public class DrmRights {
if (!isValid()) {
final String msg = "mimeType: " + mMimeType + "," +
"data: " + mData;
"data: " + Arrays.toString(mData);
throw new IllegalArgumentException(msg);
}
}

View File

@@ -189,7 +189,7 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe
protected void handleEnumerate(long deviceId, int[] fingerIds, int[] groupIds) {
if (fingerIds.length != groupIds.length) {
Slog.w(TAG, "fingerIds and groupIds differ in length: f[]="
+ fingerIds + ", g[]=" + groupIds);
+ Arrays.toString(fingerIds) + ", g[]=" + Arrays.toString(groupIds));
return;
}
if (DEBUG) Slog.w(TAG, "Enumerate: f[]=" + fingerIds + ", g[]=" + groupIds);

View File

@@ -88,6 +88,7 @@ import java.io.PrintWriter;
import java.io.StringReader;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Date;
import java.util.Map.Entry;
import java.util.Properties;
@@ -1599,7 +1600,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
switch (status) {
case GPS_REQUEST_AGPS_DATA_CONN:
if (DEBUG) Log.d(TAG, "GPS_REQUEST_AGPS_DATA_CONN");
Log.v(TAG, "Received SUPL IP addr[]: " + ipaddr);
Log.v(TAG, "Received SUPL IP addr[]: " + Arrays.toString(ipaddr));
InetAddress connectionIpAddress = null;
if (ipaddr != null) {
try {

View File

@@ -296,7 +296,7 @@ public class WifiP2pServiceResponse implements Parcelable {
sbuf.append("serviceType:").append(mServiceType);
sbuf.append(" status:").append(Status.toString(mStatus));
sbuf.append(" srcAddr:").append(mDevice.deviceAddress);
sbuf.append(" data:").append(mData);
sbuf.append(" data:").append(Arrays.toString(mData));
return sbuf.toString();
}