OSDN Git Service

Renaming bugreport.txt to bugreportFile.getName()
authorIan Pedowitz <ijpedowitz@google.com>
Thu, 18 Jun 2015 14:42:28 +0000 (07:42 -0700)
committerIan Pedowitz <ijpedowitz@google.com>
Thu, 18 Jun 2015 14:43:56 +0000 (07:43 -0700)
Many times to file a bug, its necessary to take several bugreports and
attach them all to the same bug.  With the current implementation, all
extracted files are bugreport.txt which makes it difficult to attach
several bugreports to the same bug, and reference them throughout the
bug uniquely.

Bug: 20447313
Change-Id: I22d2286d06c8dfb82273b5b98c48b21f77941b15

packages/Shell/src/com/android/shell/BugreportReceiver.java

index 13747ed..0005d6e 100644 (file)
@@ -199,7 +199,7 @@ public class BugreportReceiver extends BroadcastReceiver {
         try (InputStream is = new FileInputStream(bugreportFile);
             ZipOutputStream zos = new ZipOutputStream(
                 new BufferedOutputStream(new FileOutputStream(bugreportZippedFile)))) {
-            ZipEntry entry = new ZipEntry("bugreport.txt");
+            ZipEntry entry = new ZipEntry(bugreportFile.getName());
             zos.putNextEntry(entry);
             int totalBytes = Streams.copy(is, zos);
             Log.v(TAG, "size of original bugreport: " + totalBytes + " bytes");