Allow PRODUCT_PROPERTY_OVERRIDES to override default locale.
Change-Id: I5147d687750a50cfc186e99a9a8c88d3b2eb1692 If PRODUCT_PROPERTY_OVERRIDES has set default locale, buildinfo.sh skips setting them. http://b/issue?id=2243115
This commit is contained in:
@@ -95,6 +95,14 @@ else
|
|||||||
BUILD_DISPLAY_ID := $(build_desc)
|
BUILD_DISPLAY_ID := $(build_desc)
|
||||||
endif
|
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,
|
# Selects the first locale in the list given as the argument,
|
||||||
# and splits it into language and region, which each may be
|
# and splits it into language and region, which each may be
|
||||||
# empty.
|
# empty.
|
||||||
@@ -103,12 +111,15 @@ $(subst _, , $(firstword $(1)))
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# Selects the first locale in the list given as the argument
|
# Selects the first locale in the list given as the argument
|
||||||
# and returns the language (or the region)
|
# 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
|
define default-locale-language
|
||||||
$(word 2, 2, $(call default-locale, $(1)))
|
$(if $(product_property_override_locale_language),,\
|
||||||
|
$(word 1, $(call default-locale, $(1))))
|
||||||
endef
|
endef
|
||||||
define default-locale-region
|
define default-locale-region
|
||||||
$(word 3, 3, $(call default-locale, $(1)))
|
$(if $(product_property_overrides_locale_region),,\
|
||||||
|
$(word 2, $(call default-locale, $(1))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
BUILDINFO_SH := build/tools/buildinfo.sh
|
BUILDINFO_SH := build/tools/buildinfo.sh
|
||||||
|
@@ -25,8 +25,12 @@ if [ -n "$TARGET_CPU_ABI2" ] ; then
|
|||||||
echo "ro.product.cpu.abi2=$TARGET_CPU_ABI2"
|
echo "ro.product.cpu.abi2=$TARGET_CPU_ABI2"
|
||||||
fi
|
fi
|
||||||
echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER"
|
echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER"
|
||||||
echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE"
|
if [ -n "$PRODUCT_DEFAULT_LANGUAGE" ] ; then
|
||||||
echo "ro.product.locale.region=$PRODUCT_DEFAULT_REGION"
|
echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE"
|
||||||
|
fi
|
||||||
|
if [ -n "$PRODUCT_DEFAULT_REGION" ] ; then
|
||||||
|
echo "ro.product.locale.region=$PRODUCT_DEFAULT_REGION"
|
||||||
|
fi
|
||||||
echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
|
echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
|
||||||
echo "ro.board.platform=$TARGET_BOARD_PLATFORM"
|
echo "ro.board.platform=$TARGET_BOARD_PLATFORM"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user