summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2021-03-05 02:32:57 +0000
committer Siarhei Vishniakou <svv@google.com> 2021-03-11 03:38:48 +0000
commit4c92c5f630fc2f3a3ab15b1fd6e35e32e34534d8 (patch)
tree23b26bb9228eca41fdcc4dca4191141271bd0311 /vulkan/libvulkan/api.cpp
parent5c2a67856070668b9f886a5e1fef7694444b8a1f (diff)
Use Result<InputPublisher::Finished> instead of callback
When the 'Finished' message is received inside InputDispatcher, we are currently providing a callback function that gets executed with the parameters that are matching the InputMessage fields. This does not scale well for the case where there is more than 1 type of InputMessage received from the InputConsumer. We would have to provide 2 callbacks, which is not user-friendly. The calling code inside InputDispatcher is already aware of the InputMessage struct, but InputMessage is intended to be a protocol of communication between input channels, and is not meant to be used elsewhere. To provide the output of 'finished' signal, we introduce a new 'Finished' struct into InputPublisher. InputPublisher will now try to read a message, and will provide a response in that struct. This approach will also now force the caller to check ok(), which will increase correctness. Bug: 167947340 Test: atest inputflinger_tests Change-Id: I301c6e9c39c02692f5565aa8affdcfd0e17bcefc
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions