Permalink
Browse files

Only do bugreport on user build with ADB enabled

This makes it less likely that users that don't know what a bugreport is
will trigger it, but leaves the possibility for developers to trigger a
bugreport with a key combo.

Bug: 5866877
Change-Id: Ifc3c5126ec9342880a3635845a89c5a4a40156d2
  • Loading branch information...
1 parent b30136b commit fa351ab265957fa8815df3c4ca1f3c105f253e8b @kruton kruton committed with Justin Ho Jan 24, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 bugmailer/bugmailer.sh
View
7 bugmailer/bugmailer.sh
@@ -1,5 +1,12 @@
#!/system/bin/sh
+# Do not allow bugreports on user builds unless USB debugging
+# is enabled.
+if [ "x$(getprop ro.build.type)" = "xuser" -a \
+ "x$(getprop init.svc.adbd)" != "xrunning" ]; then
+ exit 0
+fi
+
timestamp=`date +'%Y-%m-%d-%H-%M-%S'`
storagePath="$EXTERNAL_STORAGE/bugreports"
bugreport=$storagePath/bugreport-$timestamp

0 comments on commit fa351ab

Please sign in to comment.