From 299e488ee28e75b96c23a8a37fdff2ec0f4ccb98 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 30 Mar 2016 17:16:45 -0400 Subject: [PATCH] Removing assignments to localeScriptWasComputed in aapt. On certain devices running Android M with unknown vendor modifications. Setting the localeScriptWasComputed bit in the resource parameters struct causes the translations for many languages to fail to load. The app then defaults to English. This has been reported on the following devices: Motorola XT1086, XT1096, and XT1586, HTC One, and Huawei MediaPad 10 LINK. This change works around the issue by never setting localeScriptWasComputed in aapt and instead always writing the default value of false. Bug: 27872476 Change-Id: Id638d1d0e5f9dcb1c02e65d67667d76174c69b9e --- tools/aapt/AaptAssets.cpp | 4 ---- tools/aapt2/Locale.cpp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index cbd8480efc120..c1cfd0b5f1e77 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -388,10 +388,6 @@ void AaptLocaleValue::writeTo(ResTable_config* out) const { if (script[0]) { memcpy(out->localeScript, script, sizeof(out->localeScript)); - out->localeScriptWasComputed = false; - } else { - out->computeScript(); - out->localeScriptWasComputed = true; } if (variant[0]) { diff --git a/tools/aapt2/Locale.cpp b/tools/aapt2/Locale.cpp index 12f56fc11226b..be576613b9b20 100644 --- a/tools/aapt2/Locale.cpp +++ b/tools/aapt2/Locale.cpp @@ -268,10 +268,6 @@ void LocaleValue::writeTo(ResTable_config* out) const { if (script[0]) { memcpy(out->localeScript, script, sizeof(out->localeScript)); - out->localeScriptWasComputed = false; - } else { - out->computeScript(); - out->localeScriptWasComputed = true; } if (variant[0]) {