Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb3900eb authored by Chandru S's avatar Chandru S
Browse files

Fix persisting blur issues

The blur radius value that NotificationShadeDepthController requests can change multiple times within a frame, this causes a few updates to be missed.

Fixes: 396005100
Test: verified manually
Flag: com.android.systemui.bouncer_ui_revamp
Change-Id: I9b5cf1a33af39822d699430e6f1d540144af6b2e
parent ca038b99
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -84,9 +84,16 @@ object WindowRootViewBinder {
                        combine(viewModel.blurRadius, viewModel.isBlurOpaque, ::Pair)
                            .filter { it.first >= 0 }
                            .collect { (blurRadius, isOpaque) ->
                                // Expectation is that we schedule only one blur radius value
                                // per frame
                                val newBlurRadius = blurRadius.toInt()
                                // Expectation is that we schedule only one frame callback per frame
                                if (wasUpdateScheduledForThisFrame) {
                                    // Update this value so that the frame callback picks up this
                                    // value when it runs
                                    if (lastScheduledBlurRadius != newBlurRadius) {
                                        Log.w(TAG, "Multiple blur values emitted in the same frame")
                                    }
                                    lastScheduledBlurRadius = newBlurRadius
                                    lastScheduleBlurOpaqueness = isOpaque
                                    return@collect
                                }
                                TrackTracer.instantForGroup(
@@ -94,7 +101,7 @@ object WindowRootViewBinder {
                                    "preparedBlurRadius",
                                    blurRadius,
                                )
                                lastScheduledBlurRadius = blurRadius.toInt()
                                lastScheduledBlurRadius = newBlurRadius
                                lastScheduleBlurOpaqueness = isOpaque
                                wasUpdateScheduledForThisFrame = true
                                blurUtils.prepareBlur(