crash_reporter: Use os-release.d to store the crash server url

Since all of the other configs use os-release.d rather than
system properties, switch the crash server url as well.  This also
makes the product configuration more straightforward.

Bug: 24989289
Change-Id: Ia4b423e59937a917c882e74b110b5ea520ca6016
diff --git a/crash_reporter/Android.mk b/crash_reporter/Android.mk
index 8756956..11dfcbc 100644
--- a/crash_reporter/Android.mk
+++ b/crash_reporter/Android.mk
@@ -60,6 +60,7 @@
 LOCAL_REQUIRED_MODULES := core2md \
     crash_reporter_logs.conf \
     crash_sender \
+    crash_server \
     dbus-send
 LOCAL_INIT_RC := crash_reporter.rc
 LOCAL_RTTI_FLAG := -frtti
@@ -92,6 +93,22 @@
 LOCAL_SRC_FILES := $(warn_collector_src)
 include $(BUILD_EXECUTABLE)
 
+# /etc/os-release.d/crash_server configuration file.
+# ========================================================
+ifdef OSRELEASED_DIRECTORY
+include $(CLEAR_VARS)
+LOCAL_MODULE := crash_server
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
+include $(BUILD_SYSTEM)/base_rules.mk
+
+# If the crash server isn't set, use a blank value.  crash_sender
+# will log it as a configuration error.
+$(LOCAL_BUILT_MODULE): BRILLO_CRASH_SERVER ?= ""
+$(LOCAL_BUILT_MODULE):
+	echo $(BRILLO_CRASH_SERVER) > $@
+endif
+
 # Crash reporter logs conf file.
 # ========================================================
 include $(CLEAR_VARS)