|
|
|
@ -309,9 +309,16 @@ public class Log {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void logBundle(Bundle data) {
|
|
|
|
|
if (data != null) {
|
|
|
|
|
for (String extra : getExtras(data))
|
|
|
|
|
i(extra);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static List<String> getExtras(Bundle data) {
|
|
|
|
|
List<String> result = new ArrayList<>();
|
|
|
|
|
if (data == null)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
Set<String> keys = data.keySet();
|
|
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
|
for (String key : keys) {
|
|
|
|
|
Object v = data.get(key);
|
|
|
|
|
|
|
|
|
@ -332,14 +339,10 @@ public class Log {
|
|
|
|
|
} else if (v instanceof Long)
|
|
|
|
|
value = "0x" + Long.toHexString((Long) v);
|
|
|
|
|
|
|
|
|
|
stringBuilder.append(key)
|
|
|
|
|
.append("=")
|
|
|
|
|
.append(value)
|
|
|
|
|
.append(value == null ? "" : " (" + v.getClass().getSimpleName() + ")")
|
|
|
|
|
.append("\r\n");
|
|
|
|
|
}
|
|
|
|
|
i(stringBuilder.toString());
|
|
|
|
|
result.add(key + "=" + value + (value == null ? "" : " (" + v.getClass().getSimpleName() + ")"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void logMemory(Context context, String message) {
|
|
|
|
|