default locale 设置地区

 

xxx@ubuntu-server:~$ grep -rsn "PRODUCT_DEFAULT_LOCALE" ./android/build
./android/build/core/Makefile:231:            PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
./android/build/tools/buildinfo.sh:54:if [ -n "$PRODUCT_DEFAULT_LOCALE" ] ; then
./android/build/tools/buildinfo.sh:55:  echo "ro.product.locale=$PRODUCT_DEFAULT_LOCALE"

然后通过build/tool/buildinfo.sh文件将如下段写到文件build.prop,如下:

 

 

./android/frameworks/base/core/jni/AndroidRuntime.cpp:431:    // If persist.sys.locale and ro.product.locale are missing,
./android/frameworks/base/core/jni/AndroidRuntime.cpp:433:    const std::string productLanguage = getProperty("ro.product.locale.language", "en");
./android/frameworks/base/core/jni/AndroidRuntime.cpp:434:    const std::string productRegion = getProperty("ro.product.locale.region", "US");

 

./android/frameworks/base/core/jni/AndroidRuntime.cpp:853:        const std::string locale = readLocale();

 

AndroidRuntime.cpp 

createJavaThread() --> javaCreateThreadEtc() -- > start() --> startVm()  --> readLocale()

 

 

 

你可能感兴趣的:(Android,应用)