Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds localization on android. https://github.com/user-attachments/assets/f077b194-d79e-4ca3-bdd6-806536d1627b ### Additional context: #### How Android changes the locale settings when the user does it in the settings app? Android changes the memory responsible for holding information about locale and tigers a change in two types of persistent storage, one is system prop `persist.sys.locale` and the second one is `system_locales` prop in system level settings. Before user changes the settings both of those fields are empty. When Android boots it either sets a locale to the default one or to the one specified in one of the persistent locations, it seems that if only one location exist android will still retrive the information, but conflict between `persist.sys.locale` and `system_locales` leads to unpredictable behavior. #### How to change the properties with adb? adb allows us to change system properties including `persist.sys.locale` granted we have a root access, this is achieved either by using `adb root` command or `su` command inside shell. The root access is only possible on emulators without GMS (google mobile services). adb also allows us to chage system settings using `adb shell settings` command and it does not require root access, but permanent state change of system_settings require `-writable-system` flag to be added on emulator boot, so we do it. #### How emulator command changes settings when using `-change-locale` option? Underneath emulator calls `adb shell su 0 setprop persist.sys.locale ${locale}`. #### Uncovered case: Because of the above I did not find a way to reliably change `persist.sys.locale` and scenario in which user manually changes locale (in the settings app). ### Test Plan: 1) Changing localization while using the device - turn on IDE and select android device - check if localization settings are disabled during boot process: <img width="346" alt="Screenshot 2024-10-11 at 18 13 35" src="https://github.com/user-attachments/assets/9070bb5a-5e6a-4bb2-9719-6f3d0f56aac6"> - change devices localization after it was booted up 2) Changing localization while using other available device - turn on IDE and select ios device - change devices localization after it was booted up - switch devices to android and check if the localization was configured correctly
- Loading branch information