Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev
am: d32c2a4189
Change-Id: Ie2ad590368e9c10f6222d9ae65470ebb12dabac2
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 09a004b..3dbab2c 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -746,11 +746,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!");
+ }
+
}
/**