In order to properly regress locale-related code-paths on Android, especially those related to app bundles with language splits, we need the ability to change a connected device's system locale through ADB during testing.
Since this must happen before Chrome is started, it must be provided by another application/APK. Preferably by one that implements a service that can be controlled through ADB.
For example, the "ADB Change Language" application on the Play Store does exactly this, but is not open-source.
Another interesting example is the "Custom Locale" application that comes with Android emulator system images. It is open-source (see [2]) but requires the CHANGE_CONFIGURATION permission, which should not be a problem when running out tests on userdebug builds.
Not sure about user builds, but it looks like ADB Change Language works on all unrooted recent Android versions, so this may not be a problem in practice.
[1] https://play.google.com/store/apps/details?id=net.sanapeli.adbchangelanguage
[2] https://android.googlesource.com/platform/development/+/ef1337876b2dfbf76dc7e45e035f4a25ebc0f560/apps/CustomLocale
Comment 1 by digit@google.com
, Nov 14