Merge "ledflasher: Use lights HAL if it is available."
diff --git a/config/brand b/config/brand
new file mode 100644
index 0000000..871feda
--- /dev/null
+++ b/config/brand
@@ -0,0 +1 @@
+Brillo
diff --git a/config/brillo/crash_server b/config/brillo/crash_server
new file mode 100644
index 0000000..171d033
--- /dev/null
+++ b/config/brillo/crash_server
@@ -0,0 +1,2 @@
+# Set the crash server URL.
+https://clients2.google.com/bc/report
diff --git a/config/brillo/product_id b/config/brillo/product_id
new file mode 100644
index 0000000..f74933b
--- /dev/null
+++ b/config/brillo/product_id
@@ -0,0 +1,3 @@
+# Set the product_id, which is used by the backends to route
+# metrics/crash reports to the right customer.
+developer-boards:brillo-starter-board-qualcomm
diff --git a/config/copy_files b/config/copy_files
new file mode 100644
index 0000000..7f120f1
--- /dev/null
+++ b/config/copy_files
@@ -0,0 +1,3 @@
+# Format:
+# path-in-product-dir:path-to-install-in-device
+weaved.conf:system/etc/weaved/weaved.conf
diff --git a/config/device b/config/device
new file mode 100644
index 0000000..5db86e2
--- /dev/null
+++ b/config/device
@@ -0,0 +1 @@
+dragonboard
diff --git a/config/manufacturer b/config/manufacturer
new file mode 100644
index 0000000..cb42911
--- /dev/null
+++ b/config/manufacturer
@@ -0,0 +1 @@
+google
diff --git a/config/name b/config/name
new file mode 100644
index 0000000..dd3ed88
--- /dev/null
+++ b/config/name
@@ -0,0 +1 @@
+ledflasher
diff --git a/config/packages b/config/packages
new file mode 100644
index 0000000..b100a3b
--- /dev/null
+++ b/config/packages
@@ -0,0 +1,2 @@
+ledflasher
+ledservice
diff --git a/ledflasher.mk b/ledflasher.mk
index f23c166..a1f8f34 100644
--- a/ledflasher.mk
+++ b/ledflasher.mk
@@ -14,26 +14,30 @@
 # limitations under the License.
 #
 
-$(call inherit-product, device/generic/brillo/brillo_base.mk)
+#
+# Note:
+# This file configures the product.  It follows the default format
+# generated by brunch (tools/bdk/brunch).  Any changes here should
+# be kept in sync with brunch's templates.
+#
 
-PRODUCT_NAME := ledflasher
-PRODUCT_BRAND := Brillo
+CFGTREE_ROOT := $(LOCAL_PATH)
+include device/generic/brillo/brillo_base.mk
 
-PRODUCT_DEVICE := dragonboard
+PRODUCT_NAME := $(call get_product_name_from_file)
+ifneq ($(PRODUCT_NAME),$(call cfgtree-get,name))
+  $(error config/name, <name>.mk, and AndroidProducts.mk must all be updated together.)
+endif
+PRODUCT_BRAND := $(call cfgtree-get,brand)
+PRODUCT_DEVICE := $(call cfgtree-get,device)
+PRODUCT_MANUFACTURER := $(call cfgtree-get,manufacturer)
+PRODUCT_PACKAGES += $(call cfgtree-get-if-exists,packages)
+# Populate PRODUCT_COPY_FILES from disk but avoid requiring the use of
+# $(LOCAL_PATH) by prepending it here.
+PRODUCT_COPY_FILES += $(addprefix $(LOCAL_PATH)/,$(call cfgtree-get-if-exists,copy_files))
 
-PRODUCT_PACKAGES += \
-  ledflasher \
-  ledservice \
-
-# Install LED Flasher config file for weaved.
-PRODUCT_COPY_FILES += \
-  $(LOCAL_PATH)/weaved.conf:system/etc/weaved/weaved.conf
-
+# Expect any required sepolicies in the sepolicy path.
 BOARD_SEPOLICY_DIRS := $(BOARD_SEPOLICY_DIRS) $(LOCAL_PATH)/sepolicy
 
-# Set the product_id, which is used by the backends to route
-# metrics/crash reports to the right customer.
-BRILLO_PRODUCT_ID := developer-boards:brillo-starter-board-qualcomm
-
-# Set the crash server URL.
-BRILLO_CRASH_SERVER := https://clients2.google.com/bc/report
+# Add any extra Android product.mk directive in extras.mk
+-include $(LOCAL_PATH)/extras.mk