Add support for products overriding properties in /default.prop

We need this to allow products to specify the default USB configuration,
and allow the build system to add adb to this configuration
for eng and userdebug builds.

For example:

PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
	persist.sys.usb.config=mtp

Change-Id: I83d7d918e57a8117eb96919e17d8ad52afdc0388
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/core/Makefile b/core/Makefile
index 5d4a283..237245b 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -42,6 +42,8 @@
 ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET)
 ADDITIONAL_DEFAULT_PROPERTIES := \
 	$(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
+ADDITIONAL_DEFAULT_PROPERTIES += \
+	$(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
 
 $(INSTALLED_DEFAULT_PROP_TARGET):
 	@echo Target buildinfo: $@
diff --git a/core/product.mk b/core/product.mk
index e37c2c9..2efc446 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -69,6 +69,7 @@
     PRODUCT_MANUFACTURER \
     PRODUCT_BRAND \
     PRODUCT_PROPERTY_OVERRIDES \
+    PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
     PRODUCT_CHARACTERISTICS \
     PRODUCT_COPY_FILES \
     PRODUCT_OTA_PUBLIC_KEYS \
diff --git a/core/product_config.mk b/core/product_config.mk
index df5d30e..6dc8221 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -274,6 +274,12 @@
 PRODUCT_PROPERTY_OVERRIDES := \
 	$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PROPERTY_OVERRIDES))
 
+# A list of property assignments, like "key = value", with zero or more
+# whitespace characters on either side of the '='.
+# used for adding properties to default.prop
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \
+	$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
+
 # Should we use the default resources or add any product specific overlays
 PRODUCT_PACKAGE_OVERLAYS := \
 	$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS))