OSDN Git Service

Only do bugreport on user build with ADB enabled
[android-x86/system-extras.git] / bugmailer / bugmailer.sh
index ba8eeb7..93d1c8a 100755 (executable)
@@ -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