Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa2fc0b2 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

AAPT: Include empty locale in getLocales

AAPT dump badging relies on the empty locale being
present when there are no locales.

Bug: 38192121
Test: manual
Change-Id: I2f5c431d4fd07c525a2318e7b93be0e93c32448f
parent 33532e02
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -5997,7 +5997,6 @@ void ResTable::getLocales(Vector<String8>* locales, bool includeSystemLocales,
    char locale[RESTABLE_MAX_LOCALE_LEN];

    forEachConfiguration(false, false, includeSystemLocales, [&](const ResTable_config& cfg) {
        if (cfg.locale != 0) {
        cfg.getBcp47Locale(locale, mergeEquivalentLangs /* canonicalize if merging */);

        const auto beginIter = locales->begin();
@@ -6007,7 +6006,6 @@ void ResTable::getLocales(Vector<String8>* locales, bool includeSystemLocales,
        if (iter == endIter || strcmp(iter->string(), locale) != 0) {
            locales->insertAt(String8(locale), std::distance(beginIter, iter));
        }
        }
    });
}