summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorSteve Elliott <steell@google.com>2022-02-03 16:12:58 -0500
committerSteve Elliott <steell@google.com>2022-02-04 23:01:09 -0500
commita06ea9df724414429c514677550f9eafa6270685 (patch)
tree48cd93b6a0608fd86ce24c3497b599cb8bfd11e1 /core/java/android/inputmethodservice/InputMethodService.java
parent135c992b0e3aa379c0dd27d3afa65a98a9568ec7 (diff)
Asynchronous notif pipeline evaluation
This CL introduces NotifPipelineChoreographer, which can be used to "schedule" listener invocations at a later time. In effect, this replaces the following code: foo.addListener { expensive() } bar.addListener { expensive() } With: val choreographer: NotifPipelineChoreographer = ... choreographer.addOnEvalListener { expensive() } foo.addListener { choreographer.schedule() } bar.addListener { choreographer.schedule() } This will coalesce the calls to expensive(), which will be evaluated at some point in the future when the NotifPipelineChoreographer invokes its registered OnEvalListeners. The implementation included is based on android.view.Choreographer, which will perform a scheduled evaluation at most once per frame, in conjunction with a 100ms timeout to force evaluation. The NotifPipelineChoreographer is used to coalesce all evaluations of ShadeListBuilder.buildList, which includes all Pluggable invalidations and new emissions from the NotifCollection. Test: atest, perfetto + unlock phone (transition from keyguard) and verify ShadeListBuilder.buildList is invoked at most once per frame Fixes: 217800329 Change-Id: I4be70b495bdda5a32a202a92b9b28f2cff3402c9
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions