summaryrefslogtreecommitdiff
path: root/tools/aapt2/Locale.cpp
diff options
context:
space:
mode:
author Roozbeh Pournader <roozbeh@google.com> 2016-03-03 23:45:22 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-03-03 23:45:24 +0000
commit950c9f2a95eabe3d9e50a58b11cdecb7ff857555 (patch)
tree6f5e1e558e812fe64ac694fdd83bbe86f964ff16 /tools/aapt2/Locale.cpp
parent4a6688371fd8992c0ac9e97015bcb1128efece50 (diff)
parent7960898f6f886aadda1dd3d7a89106dde9f44217 (diff)
Merge "Fix script-related parts of locale resource matching" into nyc-dev
Diffstat (limited to 'tools/aapt2/Locale.cpp')
-rw-r--r--tools/aapt2/Locale.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/aapt2/Locale.cpp b/tools/aapt2/Locale.cpp
index 6acf3b09d301..12f56fc11226 100644
--- a/tools/aapt2/Locale.cpp
+++ b/tools/aapt2/Locale.cpp
@@ -253,7 +253,7 @@ std::string LocaleValue::toDirName() const {
void LocaleValue::initFromResTable(const ResTable_config& config) {
config.unpackLanguage(language);
config.unpackRegion(region);
- if (config.localeScriptWasProvided) {
+ if (config.localeScript[0] && !config.localeScriptWasComputed) {
memcpy(script, config.localeScript, sizeof(config.localeScript));
}
@@ -268,10 +268,10 @@ void LocaleValue::writeTo(ResTable_config* out) const {
if (script[0]) {
memcpy(out->localeScript, script, sizeof(out->localeScript));
- out->localeScriptWasProvided = true;
+ out->localeScriptWasComputed = false;
} else {
out->computeScript();
- out->localeScriptWasProvided = false;
+ out->localeScriptWasComputed = true;
}
if (variant[0]) {