SystemUI: Fix bad QS scrim colors due to race in brightness mirror state#1325
Open
iusmac wants to merge 1 commit into
Conversation
* When adjusting the brightness and "qs_ui_refactor_compose_fragment" flag is enabled, the NotificationPanelViewController (NPVC) will act as BrightnessMirrorShowingInteractor, which will directly animate the QS panel alpha when showing/hiding the brightness slider mirror. Currently, NPVC races with the legacy ScrimController, which manages the entire QS scrim lifecycle, including animating the scrim alpha during QS transitions (see logs below). As a result, it causes visual inconsistencies, such as the scrim color flashing or locking to a Color.BLACK when brightness mirror is gone. This patch adds a flag to track specifically the transitioning to/from BRIGHTNESS_MIRROR, preventing the ScrimController from altering scrim colors/alpha properties that may be already handled by NPVC. Fixes crdroidandroid/issue_tracker#956 Fixes crdroidandroid/issue_tracker#1052 --- [START DRAGGING THE BRIGHTNESS SLIDER] QS panel will disappear when showing the brightness mirror. D ScrimController internalTransitionTo to state BRIGHTNESS_MIRROR D ScrimController State changed to: BRIGHTNESS_MIRROR D ScrimController Applying state: BRIGHTNESS_MIRROR D ScrimController updating scrim behind_scrim color: 0 D ScrimController updating scrim behind_scrim alpha: 0.0 D ScrimController updating scrim notifications_scrim color: 0 <-- QS panel is now of Color.BLACK D ScrimController updating scrim notifications_scrim alpha: 0.0 <-- QS panel became invisible D ScrimController updating scrim front_scrim color: 0 D ScrimController updating scrim front_scrim alpha: 0.0 D ScrimController onFinished : state=BRIGHTNESS_MIRROR D NotificationPanelView com.android.systemui:id/notification_panel: onBrightnessMirrorShowingChanged(isShowing=true) D NotificationPanelView com.android.systemui:id/notification_panel: setAlpha(alpha=0, animate=true) [STOP DRAGGING THE BRIGHTNESS SLIDER] QS panel will reappear after hiding the brightness slider but the scrim color remains black. D ScrimController internalTransitionTo to state KEYGUARD D ScrimController State changed to: KEYGUARD D ScrimController Applying state: KEYGUARD D ScrimController updating scrim behind_scrim color: 0 D ScrimController updating scrim behind_scrim alpha: 1.0 D ScrimController updating scrim notifications_scrim color: 0 <-- QS panel is still of Color.BLACK D ScrimController updating scrim notifications_scrim alpha: 1.0 <-- QS panel visible again D ScrimController updating scrim front_scrim color: 0 D ScrimController updating scrim front_scrim alpha: 0.0 D NotificationPanelView com.android.systemui:id/notification_panel: onBrightnessMirrorShowingChanged(isShowing=false) D NotificationPanelView com.android.systemui:id/notification_panel: setAlpha(alpha=255, animate=true) D ScrimController onFinished : state=KEYGUARD Signed-off-by: iusmac <iusico.maxim@libero.it>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When adjusting the brightness and "qs_ui_refactor_compose_fragment"
flag is enabled, the NotificationPanelViewController (NPVC) will act
as BrightnessMirrorShowingInteractor, which will directly animate the
QS panel alpha when showing/hiding the brightness slider mirror.
Currently, NPVC races with the legacy ScrimController, which manages
the entire QS scrim lifecycle, including animating the scrim alpha
during QS transitions (see logs below). As a result, it causes visual
inconsistencies, such as the scrim color flashing or locking to a
Color.BLACK when brightness mirror is gone.
This patch adds a flag to track specifically the transitioning to/from
BRIGHTNESS_MIRROR, preventing the ScrimController from altering scrim
colors/alpha properties that may be already handled by NPVC.
Fixes crdroidandroid/issue_tracker#956
Fixes crdroidandroid/issue_tracker#1052