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
This commit is contained in:
Todd Kennedy
2021-01-29 14:19:08 -08:00
parent c11d161d3a
commit a939273859

View File

@@ -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);