From fe41c8a0ce421cf9d6d2adad61af72a0fd570043 Mon Sep 17 00:00:00 2001 From: Rhed Jao Date: Wed, 6 Jan 2021 17:17:56 +0800 Subject: Fix missing fields when parceling the BugreportInfo Shell app exception resulted from two missing fields in BugreportInfo when it's parceling. Application ran into the duplicate logic to send notification and start foreground service then caused the exception. Bug: 176624074 Test: Request a bugreport; kill the com.android.shell; \ tap the share notification Change-Id: Ia80f5e77f5486addf9ea7822f566c3fd7d75f42a --- .../Shell/src/com/android/shell/BugreportProgressService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 63b9bb39cba0..16a6061caed2 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -2094,8 +2094,10 @@ public class BugreportProgressService extends Service { name = in.readString(); initialName = in.readString(); title = in.readString(); + shareTitle = in.readString(); description = in.readString(); progress.set(in.readInt()); + lastProgress.set(in.readInt()); lastUpdate.set(in.readLong()); formattedLastUpdate = in.readString(); bugreportFile = readFile(in); @@ -2106,9 +2108,10 @@ public class BugreportProgressService extends Service { } finished.set(in.readInt() == 1); + addingDetailsToZip = in.readBoolean(); + addedDetailsToZip = in.readBoolean(); screenshotCounter = in.readInt(); shareDescription = in.readString(); - shareTitle = in.readString(); type = in.readInt(); } @@ -2119,8 +2122,10 @@ public class BugreportProgressService extends Service { dest.writeString(name); dest.writeString(initialName); dest.writeString(title); + dest.writeString(shareTitle); dest.writeString(description); dest.writeInt(progress.intValue()); + dest.writeInt(lastProgress.intValue()); dest.writeLong(lastUpdate.longValue()); dest.writeString(getFormattedLastUpdate()); writeFile(dest, bugreportFile); @@ -2131,9 +2136,10 @@ public class BugreportProgressService extends Service { } dest.writeInt(finished.get() ? 1 : 0); + dest.writeBoolean(addingDetailsToZip); + dest.writeBoolean(addedDetailsToZip); dest.writeInt(screenshotCounter); dest.writeString(shareDescription); - dest.writeString(shareTitle); dest.writeInt(type); } -- cgit v1.2.3-59-g8ed1b