Describe the bug
When UiMode is used with the deprecated ActivityTestRule, it does not work.
This is reproducible when using android-testify, which uses ActivityTestRule under the hood
Environment
The setup in which the bug is reproducible:
Device or Emulator: Emulator
API level: Any
AndroidUiTestingUtils version: 2.0.0, but also previous
Affected Component: UiModeTestRule
Buggy Configuration: UiMode
Expected behavior
The UiMode should change accordingly
Additional context
This can be solved for API 29+ by changing the UiMode via adb.
android-testify will likely migrate to ActivityScenario in version 2.0.0, so it might not need a fix for previous versions
Describe the bug When UiMode is used with the deprecated ActivityTestRule, it does not work. This is reproducible when using android-testify, which uses ActivityTestRule under the hood
Environment The setup in which the bug is reproducible:
Expected behavior The UiMode should change accordingly
Additional context This can be solved for API 29+ by changing the UiMode via adb. android-testify will likely migrate to ActivityScenario in version 2.0.0, so it might not need a fix for previous versions