From 67c8c1e1090e8d65c315edac9102c764f4127ac7 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 19 Apr 2017 11:22:02 -0600 Subject: [PATCH] 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 --- core/java/android/content/pm/ApplicationInfo.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 8b2809af5cb2a..b0f8aa7ec6aa3 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -1203,7 +1203,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { 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 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { 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();