summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbugmailer/bugmailer.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/bugmailer/bugmailer.sh b/bugmailer/bugmailer.sh
index ba8eeb7b..93d1c8a4 100755
--- a/bugmailer/bugmailer.sh
+++ b/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