summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 346ae201cdb6..c541bbce5b7f 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -1075,16 +1075,17 @@ public class BugreportProgressService extends Service {
addEntry(zos, "title.txt", info.title);
addEntry(zos, "description.txt", info.description);
} catch (IOException e) {
- info.addingDetailsToZip = false;
Log.e(TAG, "exception zipping file " + tmpZip, e);
return;
+ } finally {
+ // Make sure it only tries to add details once, even it fails the first time.
+ info.addedDetailsToZip = true;
+ info.addingDetailsToZip = false;
}
if (!tmpZip.renameTo(info.bugreportFile)) {
Log.e(TAG, "Could not rename " + tmpZip + " to " + info.bugreportFile);
}
- info.addedDetailsToZip = true;
- info.addingDetailsToZip = false;
}
private static void addEntry(ZipOutputStream zos, String entry, String text)