Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25b130b7 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Only try to add details to zip once." into nyc-dev am: 03046888 am: 01c93c47

am: 80d5aef0

* commit '80d5aef0':
  Only try to add details to zip once.

Change-Id: I424225fafc8fbb249c69cc9dec2af97a3deae608
parents 3c04484b 80d5aef0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1084,16 +1084,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)