From b9d598c47b69406174b015ec9f064448e4b3b8b5 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 19 Jan 2016 10:31:39 -0800 Subject: [PATCH] Skip zip regeneration when user didn't provide extra info. If the user provides a title or description, it's necessary to create a new zip file with the contents of the old file plus the new entries, which takes time. Hence, if the user didn't provide more info (title or description), we should skip that step. BUG: 26616935 Change-Id: Ice14f88b5763d463d8db2f942e823797e80bfde9 --- .../Shell/src/com/android/shell/BugreportProgressService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index df8fad4dd5222..874a946dae237 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -934,6 +934,10 @@ public class BugreportProgressService extends Service { Log.e(TAG, "INTERNAL ERROR: no bugreportFile on " + info); return; } + if (TextUtils.isEmpty(info.title) && TextUtils.isEmpty(info.description)) { + Log.d(TAG, "Not touching zip file since neither title nor description are set"); + return; + } // It's not possible to add a new entry into an existing file, so we need to create a new // zip, copy all entries, then rename it. final File dir = info.bugreportFile.getParentFile();