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

Commit 1015a431 authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix jank on shade expansion

When the shade is expanded, the window becomes visible
which activates a whole series of coroutines to become
active immediately and cause jank. Until scopes are
properly put in place, keep these active and avoid
jank

Bug: 358441729
Test: use perfetto to look for missed frames
Flag: com.android.systemui.migrate_clocks_to_blueprint
Change-Id: Ia01ff0ace560e9f969eab033738eb0f4143987e6
parent c09ee07c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ constructor(
        val button = view as ImageView
        val configurationBasedDimensions = MutableStateFlow(loadFromResources(view))
        val disposableHandle =
            view.repeatWhenAttached(mainImmediateDispatcher) {
                repeatOnLifecycle(Lifecycle.State.STARTED) {
            view.repeatWhenAttached {
                repeatOnLifecycle(Lifecycle.State.CREATED) {
                    launch("$TAG#viewModel") {
                        viewModel.collect { buttonModel ->
                            updateButton(