summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
authorAbhijeet Kaur <abkaur@google.com>2019-07-25 16:09:51 +0100
committerAbhijeet Kaur <abkaur@google.com>2019-07-29 10:54:32 +0100
commit906b937b4262afcde433e0512c30d10e1af9f23a (patch)
tree099f790b7c3555f9f801425a38daa44dac053e5f /packages/Shell/src
parentd94c8e720ac3358fad9be0a5f5a671498bb9f430 (diff)
Make shell bugreport file names consistent with dumpstate
Since bugreport API workflow will be replacing old workflow of directly starting dumpstate, we aim that the resulting file names be the same as the users are used to the old file names (that dumpstate used to decide). Bug:126862297 Test: * Build and flash to the device * Turn on Settings feature flag to use the bugreport API * Take interactive and full bugreports * Output file names same as before Change-Id: I24d800e26a8cc4f739038ac0f27da13bd83f7f47
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index c9bb83c0b986..39d0a0a83f30 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -539,12 +539,17 @@ public class BugreportProgressService extends Service {
}
}
+ private String getBugreportName() {
+ String buildId = SystemProperties.get("ro.build.id", "UNKNOWN_BUILD");
+ String deviceName = SystemProperties.get("ro.product.name", "UNKNOWN_DEVICE");
+ String currentTimestamp = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date());
+ return String.format("bugreport-%s-%s-%s", deviceName, buildId, currentTimestamp);
+ }
+
private void startBugreportAPI(Intent intent) {
mUsingBugreportApi = true;
- String bugreportName = "bugreport-" + new SimpleDateFormat("yyyy-MM-dd-HH-mm").format(
- new Date());
+ String bugreportName = getBugreportName();
- // TODO(b/126862297): Make file naming same as dumpstate triggered bugreports
ParcelFileDescriptor bugreportFd = createReadWriteFile(BUGREPORT_DIR,
bugreportName + ".zip");
if (bugreportFd == null) {