Fix the timing of updating ForceInvert state and add corresponding tests
1. Use the mComputedNightMode kept in the UiModeManagerService to identify the system mode to avoid extra access to the SystemUi context and reflect the actual system theme 2. Update ForceInvert state when the mComputedNightMode is updated(content observer to the settings key UI_NIGHT_MODE is not sufficient since it will stay in MODE_NIGHT_CUSTOM if user toggle DarkTheme when they have a schedule) 3. Add tests to cover the logic for getForceInvertState Bug: 404722593 Bug: 405366199 Test: atest UiModeManagerServiceTest Flag: android.view.accessibility.force_invert_color Change-Id: I6b8048602d26d22adeb42e54bf502fa2ee5f46fa
Loading
Please register or sign in to comment