Implement locale matching in LocalesList.

The algorithm tries to find the first locale in the locale list
(usually from the user preference) that somewhat matches one of the
locales supported (usually from the list of locales supported by the
system or an app).

Locales match if both their language and their likely script is the
same. Otherwise they don't.

Bug: 25800576
Change-Id: I4fbc3f44ab16d41efebbf941e94a0bb30d598f82
4 files changed