From a939273859d6013e5f44bdb2cde264a5b6d48fae Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Fri, 29 Jan 2021 14:19:08 -0800 Subject: [PATCH] Use the correct method to unparcel the property map We were writing the map as a generic Map, but reading it as an ArrayMap. There's a subtle difference between the two methods. The generic Map creator reads the map's key using readValue(), which first reads an integer datatype and then the data. Whereas the ArrayMap creator knows the keys are Strings and thus calls readString() directly without consuming the datatype. This throws the parcel reading logic out of whack. Fixes: 176295431 Test: manual Change-Id: I2d32488e3339e2d838e680be1ed9476b9e15cd69 --- core/java/android/content/pm/parsing/ParsingPackageImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/java/android/content/pm/parsing/ParsingPackageImpl.java b/core/java/android/content/pm/parsing/ParsingPackageImpl.java index 72c9879c93607..97e1b543520ef 100644 --- a/core/java/android/content/pm/parsing/ParsingPackageImpl.java +++ b/core/java/android/content/pm/parsing/ParsingPackageImpl.java @@ -72,7 +72,6 @@ import com.android.internal.util.Parcelling.BuiltIn.ForInternedStringValueMap; import com.android.internal.util.Parcelling.BuiltIn.ForStringSet; import java.security.PublicKey; -import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -1346,7 +1345,7 @@ public class ParsingPackageImpl implements ParsingPackage, Parcelable { this.gwpAsanMode = in.readInt(); this.minExtensionVersions = in.readSparseIntArray(); this.mBooleans = in.readLong(); - this.mProperties = in.createTypedArrayMap(Property.CREATOR); + this.mProperties = in.readHashMap(boot); this.memtagMode = in.readInt(); this.nativeHeapZeroInitialized = in.readInt(); this.requestOptimizedExternalStorageAccess = sForBoolean.unparcel(in);