From 7a9612f032a5a759117ce712b89a173048c5d621 Mon Sep 17 00:00:00 2001 From: Sundeep Ghuman Date: Thu, 12 Jan 2017 13:48:51 -0800 Subject: [PATCH] Fix ScoredNetwork: unparcel bundle in toString. Calling isEmpty will ensure the bundle is unparceled before converting to a string. Test: dumped network_score Change-Id: Icaa4e736af55c6112805a2ce0e829739bbb5b312 --- core/java/android/net/ScoredNetwork.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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('}');