summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-01-22 18:53:59 +0000
committerNarayan Kamath <narayan@google.com>2015-01-22 18:53:59 +0000
commit675a726fe4ca70beb1ecccb8c5f78dcc8f65cac8 (patch)
tree1277544d3f6326a58a7ab5cd5c74eb44c8ef6319
parent30a0031e4388a54890071e7c386b20c81509f27f (diff)
parent8f5fc9e246e3ecebbb4cf4768da027e6e34d40d5 (diff)
downloadbuild-675a726fe4ca70beb1ecccb8c5f78dcc8f65cac8.zip
build-675a726fe4ca70beb1ecccb8c5f78dcc8f65cac8.tar.gz
build-675a726fe4ca70beb1ecccb8c5f78dcc8f65cac8.tar.bz2
resolved conflicts for merge of 8f5fc9e2 to lmp-mr1-dev-plus-aosp
Change-Id: Ie1587a4e2434b9cfbca16bc764e99e94511f8212
-rw-r--r--CleanSpec.mk4
-rw-r--r--core/Makefile32
-rwxr-xr-xtools/buildinfo.sh7
3 files changed, 13 insertions, 30 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk
index fc908de..5b18d44 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -325,6 +325,10 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/*)
+# Remove ro.product.locale.language/country and add ro.product.locale
+# instead.
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index bf333e2..05cda6e 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -156,29 +156,12 @@ else
BUILD_DISPLAY_ID := $(build_desc)
endif
-# Whether there is default locale set in PRODUCT_PROPERTY_OVERRIDES
-product_property_override_locale_language := $(strip \
- $(patsubst ro.product.locale.language=%,%,\
- $(filter ro.product.locale.language=%,$(PRODUCT_PROPERTY_OVERRIDES))))
-product_property_overrides_locale_region := $(strip \
- $(patsubst ro.product.locale.region=%,%,\
- $(filter ro.product.locale.region=%,$(PRODUCT_PROPERTY_OVERRIDES))))
-
-# Selects the first locale in the list given as the argument,
-# and splits it into language and region, which each may be
-# empty.
-define default-locale
-$(subst _, , $(firstword $(1)))
-endef
-
-# Selects the first locale in the list given as the argument
-# and returns the language (or the region), if it's not set in PRODUCT_PROPERTY_OVERRIDES;
-# Return empty string if it's already set in PRODUCT_PROPERTY_OVERRIDES.
-define default-locale-language
-$(if $(product_property_override_locale_language),,$(word 1, $(call default-locale, $(1))))
-endef
-define default-locale-region
-$(if $(product_property_overrides_locale_region),,$(word 2, $(call default-locale, $(1))))
+# Accepts a whitespace separated list of product locales such as
+# (en_US en_AU en_GB...) and returns the first locale in the list with
+# underscores replaced with hyphens. In the example above, this will
+# return "en-US".
+define get-default-product-locale
+$(strip $(subst _,-, $(firstword $(1))))
endef
BUILDINFO_SH := build/tools/buildinfo.sh
@@ -204,8 +187,7 @@ endif
TARGET_DEVICE="$(TARGET_DEVICE)" \
PRODUCT_NAME="$(TARGET_PRODUCT)" \
PRODUCT_BRAND="$(PRODUCT_BRAND)" \
- PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \
- PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \
+ PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
PRODUCT_MODEL="$(PRODUCT_MODEL)" \
PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index a80b2db..dcd9ab5 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -36,11 +36,8 @@ echo "ro.product.cpu.abilist32=$TARGET_CPU_ABI_LIST_32_BIT"
echo "ro.product.cpu.abilist64=$TARGET_CPU_ABI_LIST_64_BIT"
echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER"
-if [ -n "$PRODUCT_DEFAULT_LANGUAGE" ] ; then
- echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE"
-fi
-if [ -n "$PRODUCT_DEFAULT_REGION" ] ; then
- echo "ro.product.locale.region=$PRODUCT_DEFAULT_REGION"
+if [ -n "$PRODUCT_DEFAULT_LOCALE" ] ; then
+ echo "ro.product.locale=$PRODUCT_DEFAULT_LOCALE"
fi
echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
echo "ro.board.platform=$TARGET_BOARD_PLATFORM"