Simplify Makefile for metrics_daemon.
We can use the LOCAL_INIT_RC variable for init.rc files.
Also, switch to use <service>.rc for the filename, since this is what
Android does now.
Bug: 24465893
Change-Id: Ibf4715c3b0352422b98afc04abfd68a42a46149c
diff --git a/metricsd/Android.mk b/metricsd/Android.mk
index c35f4e8..33446e9 100644
--- a/metricsd/Android.mk
+++ b/metricsd/Android.mk
@@ -16,8 +16,6 @@
ifeq ($(HOST_OS),linux)
-LOCAL_INIT_SERVICE := metrics_daemon
-
metrics_cpp_extension := .cc
libmetrics_sources := \
c_metrics_library.cc \
@@ -124,13 +122,13 @@
# metrics daemon.
# ========================================================
include $(CLEAR_VARS)
-LOCAL_MODULE := $(LOCAL_INIT_SERVICE)
+LOCAL_MODULE := metrics_daemon
LOCAL_C_INCLUDES := $(metrics_includes) \
external/libchromeos
LOCAL_CFLAGS := $(metrics_CFLAGS)
LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
-LOCAL_REQUIRED_MODULES := init.$(LOCAL_INIT_SERVICE).rc
+LOCAL_INIT_RC := metrics_daemon.rc
LOCAL_RTTI_FLAG := -frtti
LOCAL_SHARED_LIBRARIES := $(metrics_shared_libraries) \
libmetrics \
@@ -146,15 +144,6 @@
LOCAL_STATIC_LIBRARIES := metrics_daemon_protos
include $(BUILD_EXECUTABLE)
-ifdef INITRC_TEMPLATE
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.$(LOCAL_INIT_SERVICE).rc
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
-LOCAL_SRC_FILES := init.$(LOCAL_INIT_SERVICE).rc
-include $(BUILD_PREBUILT)
-endif # INITRC_TEMPLATE
-
# Unit tests for metrics.
# ========================================================
include $(CLEAR_VARS)
diff --git a/metricsd/init.metrics_daemon.rc b/metricsd/metrics_daemon.rc
similarity index 100%
rename from metricsd/init.metrics_daemon.rc
rename to metricsd/metrics_daemon.rc