AndroidUiTestingUtils
AndroidUiTestingUtils copied to clipboard
SystemLocaleTestRule failing for the first test ONLY on first run.
Describe the bug SystemLocaleTestRule does not always work the very first time the Tests run on a device/emulator, silently failing for the very first test ONLY with a SecurityException. Therefore, for that test ONLY is the System Locale not changed.
Environment The setup in which the bug is reproducible:
- Device or Emulator: Device or emulator
- API level: any API
- AndroidUiTestingUtils version: 1.2.1
- Affected Component: SystemLocaleTestRule and ActivityScenarioForActivityRule(systemLocale ="my_locale"), which uses SystemLocaleTestRule internally.
Expected behavior Must change the SystemLocale for every single test.
Additional context This is happening because the SystemLocalTestRule is trying to change the system locale before the CHANGE_CONFIGURATION permission is granted.