Some folks like sending null fields.
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.ComponentInfoTest
Bug: 37495524
Change-Id: I9040534d717ac70d580bd2a7f5488369ab7c3a47
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 8b2809a..b0f8aa7 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -1203,7 +1203,12 @@
dest.writeInt(requiresSmallestWidthDp);
dest.writeInt(compatibleWidthLimitDp);
dest.writeInt(largestWidthLimitDp);
- dest.writeUuid(storageUuid);
+ if (storageUuid != null) {
+ dest.writeInt(1);
+ dest.writeUuid(storageUuid);
+ } else {
+ dest.writeInt(0);
+ }
dest.writeString(scanSourceDir);
dest.writeString(scanPublicSourceDir);
dest.writeString(sourceDir);
@@ -1265,8 +1270,10 @@
requiresSmallestWidthDp = source.readInt();
compatibleWidthLimitDp = source.readInt();
largestWidthLimitDp = source.readInt();
- storageUuid = source.readUuid();
- volumeUuid = StorageManager.convert(storageUuid);
+ if (source.readInt() != 0) {
+ storageUuid = source.readUuid();
+ volumeUuid = StorageManager.convert(storageUuid);
+ }
scanSourceDir = source.readString();
scanPublicSourceDir = source.readString();
sourceDir = source.readString();