am fa351ab2: Only do bugreport on user build with ADB enabled

* commit 'fa351ab265957fa8815df3c4ca1f3c105f253e8b':
  Only do bugreport on user build with ADB enabled
diff --git a/bugmailer/bugmailer.sh b/bugmailer/bugmailer.sh
index ba8eeb7..93d1c8a 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