[rk3399] [Android 7.1] debugging notes: set the default startup language to Chinese

Keywords: Android git Makefile github

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

resolvent:

diff --git a/target/product/full_base.mk b/target/product/full_base.mk
index 65bdf0f..071d299 100644
--- a/target/product/full_base.mk
+++ b/target/product/full_base.mk
@@ -43,7 +43,8 @@ PRODUCT_PROPERTY_OVERRIDES := \
     ro.config.notification_sound=pixiedust.ogg

 # Put en_US first in the list, so make it default.
-PRODUCT_LOCALES := en_US
+#Kris,180713, Use Chinese as default.
+PRODUCT_LOCALES := zh_CN

 # Get some sounds
 $(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)

The following parts can also be left unchanged, mainly used to reduce unused language packs.

diff --git a/target/product/locales_full.mk b/target/product/locales_full.mk
index 3a90d2b..a2e1cf0 100644
--- a/target/product/locales_full.mk
+++ b/target/product/locales_full.mk
@@ -1,3 +1,6 @@
-PRODUCT_LOCALES := en_US cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG eo_EU es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_B
+#PRODUCT_LOCALES := en_US cs_CZ da_DK de_AT de_CH de_DE de_LI el_GR en_AU en_CA en_GB en_NZ en_SG eo_EU es_ES fr_CA fr_CH fr_BE fr_FR it_CH it_IT ja_JP ko_KR nb_NO nl_

-$(call inherit-product, build/target/product/languages_full.mk)
+#$(call inherit-product, build/target/product/languages_full.mk)
+
+#Kris, 180713, Only use following languages.
+PRODUCT_LOCALES := en_US zh_HK zh_TW ja_JP fr_FR

There are several. mk products under target/product. To quickly determine which files are used, you can directly use them in the files
Add compilation information.

Principle:

Product? Locales is used when compiling build.prop.
build/core/Makefile:

$(intermediate_system_build_prop): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET)
    @echo Target buildinfo: $@
    ......
    PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \

Get default product locale returns the first locale

define get-default-product-locale
$(strip $(subst _,-, $(firstword $(1))))
endef

Product "default" locale is finally compiled into ro.product.locale, so it is essentially the same when you directly set this property in system.prop.
build/tools/buildinfo.sh

if [ -n "$PRODUCT_DEFAULT_LOCALE" ] ; then
  echo "ro.product.locale=$PRODUCT_DEFAULT_LOCALE"
fi

Reference resources:
[GitHub][Android] Change locale, default locale, language list
[Google] languages and language regions

Posted by shaundunne on Sat, 15 Feb 2020 10:26:33 -0800