am e0849423: am 501bb0a5: Merge "Fix issue when converting fil->tl."
* commit 'e0849423214007d4377638fb42db15276e3ca575':
Fix issue when converting fil->tl.
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 @@
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 @@
// 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) {