Merge "Fix NPE in logging" am: ceba9c2521 am: 01ca11578f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1736917 Change-Id: I34e9ac464bf0f2d35f86c7fbf716c0a006d6ecb4
This commit is contained in:
@@ -937,17 +937,18 @@ public final class OobData implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String toHexString(@NonNull int b) {
|
private String toHexString(int b) {
|
||||||
return toHexString(new byte[] {(byte) b});
|
return toHexString(new byte[] {(byte) b});
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String toHexString(@NonNull byte b) {
|
private String toHexString(byte b) {
|
||||||
return toHexString(new byte[] {b});
|
return toHexString(new byte[] {b});
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String toHexString(@NonNull byte[] array) {
|
private String toHexString(byte[] array) {
|
||||||
|
if (array == null) return "null";
|
||||||
StringBuilder builder = new StringBuilder(array.length * 2);
|
StringBuilder builder = new StringBuilder(array.length * 2);
|
||||||
for (byte b: array) {
|
for (byte b: array) {
|
||||||
builder.append(String.format("%02x", b));
|
builder.append(String.format("%02x", b));
|
||||||
|
|||||||
Reference in New Issue
Block a user