summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
author Stefan Andonian <andonian@google.com> 2024-10-15 04:29:57 +0000
committer Stefan Andonian <andonian@google.com> 2024-10-23 04:40:21 +0000
commit0bd19ff7cb9deead40ffcdb319e6fffc3a183d43 (patch)
tree22946a2561b6f799f3efeab08135f3841e524ee9 /packages/Shell/src
parent1e03a468dbd4e3ba12b947d6d1dd3cf1effd2553 (diff)
[Record Issue QS Tile] Allow Bug report flow to also have screen
recording metadata Bug: 372973430 Test: Verified that the whole flow worked fine locally. Flag: EXEMPT small update Change-Id: I794a4c1cfb972a9aa0f5a3165671f7bfbdcffda7
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index bcfd8f620f9c..0a68e6791df5 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -90,10 +90,10 @@ import com.android.internal.app.ChooserActivity;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import libcore.io.Streams;
-
import com.google.android.collect.Lists;
+import libcore.io.Streams;
+
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -171,8 +171,8 @@ public class BugreportProgressService extends Service {
static final String EXTRA_DESCRIPTION = "android.intent.extra.DESCRIPTION";
static final String EXTRA_ORIGINAL_INTENT = "android.intent.extra.ORIGINAL_INTENT";
static final String EXTRA_INFO = "android.intent.extra.INFO";
- static final String EXTRA_EXTRA_ATTACHMENT_URI =
- "android.intent.extra.EXTRA_ATTACHMENT_URI";
+ static final String EXTRA_EXTRA_ATTACHMENT_URIS =
+ "android.intent.extra.EXTRA_ATTACHMENT_URIS";
private static final int MSG_SERVICE_COMMAND = 1;
private static final int MSG_DELAYED_SCREENSHOT = 2;
@@ -682,10 +682,11 @@ public class BugreportProgressService extends Service {
long nonce = intent.getLongExtra(EXTRA_BUGREPORT_NONCE, 0);
String baseName = getBugreportBaseName(bugreportType);
String name = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date());
- Uri extraAttachment = intent.getParcelableExtra(EXTRA_EXTRA_ATTACHMENT_URI, Uri.class);
+ List<Uri> extraAttachments =
+ intent.getParcelableArrayListExtra(EXTRA_EXTRA_ATTACHMENT_URIS, Uri.class);
BugreportInfo info = new BugreportInfo(mContext, baseName, name, shareTitle,
- shareDescription, bugreportType, mBugreportsDir, nonce, extraAttachment);
+ shareDescription, bugreportType, mBugreportsDir, nonce, extraAttachments);
synchronized (mLock) {
if (info.bugreportFile.exists()) {
Log.e(TAG, "Failed to start bugreport generation, the requested bugreport file "
@@ -1233,9 +1234,13 @@ public class BugreportProgressService extends Service {
clipData.addItem(new ClipData.Item(null, null, null, screenshotUri));
attachments.add(screenshotUri);
}
- if (info.extraAttachment != null) {
- clipData.addItem(new ClipData.Item(null, null, null, info.extraAttachment));
- attachments.add(info.extraAttachment);
+ if (info.extraAttachments != null) {
+ info.extraAttachments.forEach(it -> {
+ if (it != null) {
+ clipData.addItem(new ClipData.Item(null, null, null, it));
+ attachments.add(it);
+ }
+ });
}
intent.setClipData(clipData);
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, attachments);
@@ -2096,7 +2101,7 @@ public class BugreportProgressService extends Service {
final long nonce;
@Nullable
- public Uri extraAttachment = null;
+ public List<Uri> extraAttachments = null;
private final Object mLock = new Object();
@@ -2106,7 +2111,7 @@ public class BugreportProgressService extends Service {
BugreportInfo(Context context, String baseName, String name,
@Nullable String shareTitle, @Nullable String shareDescription,
@BugreportParams.BugreportMode int type, File bugreportsDir, long nonce,
- @Nullable Uri extraAttachment) {
+ @Nullable List<Uri> extraAttachments) {
this.context = context;
this.name = this.initialName = name;
this.shareTitle = shareTitle == null ? "" : shareTitle;
@@ -2115,7 +2120,7 @@ public class BugreportProgressService extends Service {
this.nonce = nonce;
this.baseName = baseName;
this.bugreportFile = new File(bugreportsDir, getFileName(this, ".zip"));
- this.extraAttachment = extraAttachment;
+ this.extraAttachments = extraAttachments;
}
void createBugreportFile() {