Flounder: Add mini-debug-info to userdebug

Add mini-debug-info to preopted boot image and system server to
aid diagnosing native crashes.

Change-Id: Ib4da4869aa9c04b1102742318c0c387d580f6d6b
diff --git a/device.mk b/device.mk
index f040b2a..be84c1d 100644
--- a/device.mk
+++ b/device.mk
@@ -263,6 +263,17 @@
     af.fast_track_multiplier=1 \
     audio_hal.period_size=128
 
+# In userdebug, add minidebug info the the boot image and the system server to support
+# diagnosing native crashes.
+ifneq (,$(filter userdebug, $(TARGET_BUILD_VARIANT)))
+    # Boot image.
+    PRODUCT_DEX_PREOPT_BOOT_FLAGS += --generate-mini-debug-info
+    # System server and some of its services.
+    # Note: we cannot use PRODUCT_SYSTEM_SERVER_JARS, as it has not been expanded at this point.
+    $(call add-product-dex-preopt-module-config,services,--generate-mini-debug-info)
+    $(call add-product-dex-preopt-module-config,wifi-service,--generate-mini-debug-info)
+endif
+
 # add verity dependencies
 $(call inherit-product, build/target/product/verity.mk)
 PRODUCT_SUPPORTS_BOOT_SIGNER := false