Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev am: d32c2a4189 am: 1f5050c054
am: 4fda414ed6
Change-Id: I7c7901f0147f7577240803cc2adc4e189f1994b4
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 5142928..460f125 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -835,11 +835,19 @@
return;
}
Set<Map.Entry<String,Object>> entries = val.entrySet();
- writeInt(entries.size());
+ int size = entries.size();
+ writeInt(size);
+
for (Map.Entry<String,Object> e : entries) {
writeValue(e.getKey());
writeValue(e.getValue());
+ size--;
}
+
+ if (size != 0) {
+ throw new BadParcelableException("Map size does not match number of entries!");
+ }
+
}
/**