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

Commit e8e559f3 authored by Nick Chameyev's avatar Nick Chameyev Committed by Automerger Merge Worker
Browse files

Merge "Use async callback for unfold overlay synchronization" into tm-dev am:...

Merge "Use async callback for unfold overlay synchronization" into tm-dev am: 39f02b6f am: f343ca2c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17540005



Change-Id: I5d05211748afb3c4e82e317eb0664a6b9067c289
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6ca79ab8 f343ca2c
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -155,21 +155,22 @@ constructor(
            newRoot.relayout(params) { transaction ->
                val vsyncId = Choreographer.getSfInstance().vsyncId

                backgroundExecutor.execute {
                    // Apply the transaction that contains the first frame of the overlay
                    // synchronously and apply another empty transaction with
                    // 'vsyncId + 1' to make sure that it is actually displayed on
                    // the screen. The second transaction is necessary to remove the screen blocker
                    // (turn on the brightness) only when the content is actually visible as it
                // Apply the transaction that contains the first frame of the overlay and apply
                // another empty transaction with 'vsyncId + 1' to make sure that it is actually
                // displayed on the screen. The second transaction is necessary to remove the screen
                // blocker (turn on the brightness) only when the content is actually visible as it
                // might be presented only in the next frame.
                // See b/197538198
                    transaction.setFrameTimelineVsync(vsyncId).apply(/* sync */ true)

                    transaction.setFrameTimelineVsync(vsyncId + 1).apply(/* sync */ true)
                transaction
                    .setFrameTimelineVsync(vsyncId)
                    .apply()

                transaction.setFrameTimelineVsync(vsyncId + 1)
                    .addTransactionCommittedListener(backgroundExecutor) {
                        Trace.endAsyncSection("UnfoldLightRevealOverlayAnimation#relayout", 0)
                        callback.run()
                    }
                    .apply()
            }
        }