summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
authorAbhijeet Kaur <abkaur@google.com>2020-03-30 17:18:00 +0100
committerAbhijeet Kaur <abkaur@google.com>2020-03-30 17:25:04 +0100
commit982b1047556b3ee0b950e4adee2abafa28bc02fd (patch)
treeaf9b9ff97029ad3f3e076b5f2a4188a215343da8 /packages/Shell/src
parent09b1ee60774eeac165b951e3f2263043019cc009 (diff)
Delete bugreport file on bugreport cancel
Note: bugreport Cancel is not the same as bugreport onError. Files are not deleted onError, as it still has some information before the bugreport crashed/stopped. Bugreport Cancel is triggered by the user, hence clean up all the files. Bug: 146994281 Test: Cancel interactive bugreport from UI, deletes the current bugreport files Change-Id: I2606e491cbaa20eaa60980e98af56a194bae2280
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 64e52376effd..fa3ba688afc3 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -817,6 +817,7 @@ public class BugreportProgressService extends Service {
Log.i(TAG, "Cancelling bugreport service (ID=" + id + ") on user's request");
mBugreportManager.cancelBugreport();
info.deleteScreenshots();
+ info.deleteBugreportFile();
}
stopProgressLocked(id);
}
@@ -1968,6 +1969,14 @@ public class BugreportProgressService extends Service {
}
/**
+ * Deletes bugreport file for a given bugreport.
+ */
+ private void deleteBugreportFile() {
+ Log.i(TAG, "Deleting bugreport file " + bugreportFile);
+ bugreportFile.delete();
+ }
+
+ /**
* Rename all screenshots files so that they contain the new {@code name} instead of the
* {@code initialName} if user has changed it.
*/