end2end: Implement a fake IComposerClient [4/N]
Implements a minimal but function ComposerClient which responds to all the initial SurfaceFlinger queries needed to allow fake physical displays to be connected and used. The implementation code is split into two parts. First is a series of special delegating helper implementations, located under the hwc3/delegators directory. These implement the full interface by delegating to a templated handler function. This allows the default behavior for the full interface to be specified by just writing a single function, whether that behavior is to return an error for all calls, or to do something else. This is then used as a base class by the actual implementation which focuses on overriding only the interface functions which need special handling. The existing files are shuffled around a bit, as the delegators will be reused by a subsequent CL to define a intercepting/forwarding observer implementation, and this will be distinct from the "fake" implementation as it will eventually be used to observe the interactions between SF and the drm_hwcomposer real implementation for use by the test. This change also introduces a local SharedMutex helper, which wraps `std::shared_mutex` and enforces the correct locking for the two types of access (exclusive or shared). The shared mutex allows the display changes to be made by the test potentially at the same time as SF is making calls to query the display properties. With the fake implementation correctly configured for SurfaceFlinger to use, SF now boots and enters a usable state. The test can now control SF through the front-end interfaces, though there are other changes still needed to make presentation work. Flag: TEST_ONLY Bug: 372735083 Test: atest surfaceflinger_end2end_tests Change-Id: Ic67ed4ed0627649c70910cb20643bfa0c7b75208
Loading
Please register or sign in to comment