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

Commit ab4da4f4 authored by Mark Punzalan's avatar Mark Punzalan Committed by Michael Bestas
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
(cherry-picked from commit a1d1e800)
parent 0166a839
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