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
This commit is contained in:
Rhed Jao
2021-01-06 17:17:56 +08:00
parent 61e082abdb
commit fe41c8a0ce

View File

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