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

Commit c93b9e5f authored by Luca Zuccarini's avatar Luca Zuccarini Committed by Android (Google) Code Review
Browse files

Merge "Fix misclassified jank for CUJ SHADE_DIALOG_OPEN (and others)." into main

parents 8328d0f1 b68521d9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1984,3 +1984,13 @@ flag {
     purpose: PURPOSE_BUGFIX
   }
}

flag {
    name: "fix_dialog_launch_animation_jank_logging"
    namespace: "systemui"
    description: "Adjust timing of jank logging for dialog launch animations, and attach it to the dialog window instead of the origin view window."
    bug: "409008342"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+22 −9
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ constructor(
         * controlled by this controller.
         */
        // TODO(b/252723237): Make this non-nullable
        @Deprecated("Jank should be measured in the dialog's window, not the origin view's")
        fun jankConfigurationBuilder(): InteractionJankMonitor.Configuration.Builder?

        companion object {
@@ -576,6 +577,7 @@ private class AnimatedDialog(
    private var hasInstrumentedJank = false

    fun start() {
        if (!Flags.fixDialogLaunchAnimationJankLogging()) {
            val cuj = controller.cuj
            if (cuj != null) {
                val config = controller.jankConfigurationBuilder()
@@ -588,6 +590,7 @@ private class AnimatedDialog(
                    hasInstrumentedJank = true
                }
            }
        }

        // Create the dialog so that its onCreate() method is called, which usually sets the dialog
        // content.
@@ -784,6 +787,16 @@ private class AnimatedDialog(
            return
        }

        if (Flags.fixDialogLaunchAnimationJankLogging()) {
            controller.cuj?.let { cuj ->
                val config =
                    InteractionJankMonitor.Configuration.Builder.withView(cuj.cujType, decorView)
                if (cuj.tag != null) config.setTag(cuj.tag)
                interactionJankMonitor.begin(config)
                hasInstrumentedJank = true
            }
        }

        // Show the background dim.
        dialog.window?.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)