diff options
author | Narayan Kamath <narayan@google.com> | 2014-07-05 15:33:28 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-07-07 09:51:01 +0100 |
commit | fec5106c8ea5791614385c17bd1bf0ecff9afe9a (patch) | |
tree | 0363b6f432a15d0f00450c1fff36a5c2bdaa50f4 /libs/androidfw | |
parent | 358a3f716850e96716b766c63d50d3425a4c9ed7 (diff) | |
download | frameworks_base-fec5106c8ea5791614385c17bd1bf0ecff9afe9a.zip frameworks_base-fec5106c8ea5791614385c17bd1bf0ecff9afe9a.tar.gz frameworks_base-fec5106c8ea5791614385c17bd1bf0ecff9afe9a.tar.bz2 |
Fix issue when converting fil->tl.
We should call ResourceTable::getLocales directly,
and not AssetManager::getLocales. The latter will convert
"tl" to "fil" so we'll end up thinking we have resources
for "fil" when we don't really have any.
bug: 15873165
Change-Id: I9753e4608aaecede328a40ee1f3ee6b016d0dedc
Diffstat (limited to 'libs/androidfw')
-rw-r--r-- | libs/androidfw/AssetManager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 482dfc8..56c95bd 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -365,7 +365,6 @@ void AssetManager::setLocaleLocked(const char* locale) delete[] mLocale; } - // If we're attempting to set a locale that starts with "fil", // we should convert it to "tl" for backwards compatibility since // we've been using "tl" instead of "fil" prior to L. @@ -374,7 +373,10 @@ void AssetManager::setLocaleLocked(const char* locale) // instead of attempting a fallback. if (strncmp(locale, kFilPrefix, kFilPrefixLen) == 0) { Vector<String8> locales; - getLocales(&locales); + ResTable* res = mResources; + if (res != NULL) { + res->getLocales(&locales); + } const size_t localesSize = locales.size(); bool hasFil = false; for (size_t i = 0; i < localesSize; ++i) { |