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

Commit d6bbc6c2 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Instrument dialog/app launches when animating from Compose UIs

This CL adds instrumentation for Activity and Dialog launches from
Compose code. All the abstractions were ready for that but I forgot to
do the actual calls to InteractionJankMonitor and closed b/252723237 too
early after seeing the reply in b/252723237#comment5.

Bug: 252723237
Test: Ran SettingsButtonMicrobenchmark and PowerMenuButtonMicrobenchmark
 using the command lines in http://go/sysui-compose-performance-results.
 Double checked that the cuj_SHADE_APP_LAUNCH_FROM_SETTINGS_BUTTON_* and
 cuj_SHADE_DIALOG_OPEN_* metrics were collected.
Change-Id: Idac0bcff780d4de2e16b4181b85761e2244d3fb9
parent 3658b892
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -263,9 +263,11 @@ internal class ExpandableControllerImpl(
            override fun onLaunchAnimationStart(isExpandingFullyAbove: Boolean) {
                delegate.onLaunchAnimationStart(isExpandingFullyAbove)
                overlay.value = composeViewRoot.rootView.overlay as ViewGroupOverlay
                cujType?.let { InteractionJankMonitor.getInstance().begin(composeViewRoot, it) }
            }

            override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) {
                cujType?.let { InteractionJankMonitor.getInstance().end(it) }
                delegate.onLaunchAnimationEnd(isExpandingFullyAbove)
                overlay.value = null
            }
@@ -320,9 +322,8 @@ internal class ExpandableControllerImpl(
            }

            override fun jankConfigurationBuilder(): InteractionJankMonitor.Configuration.Builder? {
                // TODO(b/252723237): Add support for jank monitoring when animating from a
                // Composable.
                return null
                val type = cuj?.cujType ?: return null
                return InteractionJankMonitor.Configuration.Builder.withView(type, composeViewRoot)
            }
        }
    }