diff --git a/core/java/android/net/ScoredNetwork.java b/core/java/android/net/ScoredNetwork.java index c86c25a86f834..d396b50263be7 100644 --- a/core/java/android/net/ScoredNetwork.java +++ b/core/java/android/net/ScoredNetwork.java @@ -219,7 +219,8 @@ public class ScoredNetwork implements Parcelable { "networkKey=" + networkKey + ", rssiCurve=" + rssiCurve + ", meteredHint=" + meteredHint); - if (attributes != null) { + // calling isEmpty will unparcel the bundle so its contents can be converted to a string + if (attributes != null && !attributes.isEmpty()) { out.append(", attributes=" + attributes); } out.append('}');