summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
author Narayan Kamath <narayan@google.com> 2014-07-07 08:57:04 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-07-07 08:57:04 +0000
commite0849423214007d4377638fb42db15276e3ca575 (patch)
tree6b913063e1d1172bddfeed81b155d96b68fd7bef /libs/androidfw/AssetManager.cpp
parent7228aa109aaef18b8447b369ae2a90cecf2c9601 (diff)
parent501bb0a5e4a62a9e58efe2fa0a3f275c193872e7 (diff)
am 501bb0a5: Merge "Fix issue when converting fil->tl."
* commit '501bb0a5e4a62a9e58efe2fa0a3f275c193872e7': Fix issue when converting fil->tl.
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
-rw-r--r--libs/androidfw/AssetManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 482dfc8933cf..56c95bd886ed 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) {