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

Commit a1d1e800 authored by Mark Punzalan's avatar Mark Punzalan
Browse files

Ensure there is at least one locale in the Configuration object

When there is no intersection between the system locales and the
app-supported locales defined in the LocaleConfig, the locales in the
Configuration object are set to an empty LocaleList, which can trigger a
crash (NullPointerException) in the app and possibly in system_server or
systemui in some cases.

This fixes that issue by falling back in that case to the previous
behavior (before the improved resource multi-locale support) of
selecting the best matching locale available in the app (if any), or the
first system locale.

Additionally:
- Renamed `calcConfigChanges` to `applyConfigChanges` because it applies the new configuration in addition to calculating the changes.
- Added more comments to explain the locale selection logic.

Bug: 400163083
Test: Manually on Pixel 6 Pro with repro steps in b/400163083#comment18
Flag: EXEMPT bugfix
Change-Id: I3f525b44f89589d521b3d3408a976b11b1cfe064
parent 11538b19
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment