SF: Introduce struct surfaceflinger::Config
This pulls out all the individual configuration constants read by SurfaceFlinger in its constructor, and moves them to a new surfaceflinger::Config structure which is passed to the constructor. All the initialization is the functionally the same, a few values turned out to not be used, so were removed (mMaxGraphicBufferProducerListSize, mGraphicBufferProducerListSizeLogThreshold). Otherwise all properties read for the new structure consistently use android-base/properties.h to read them. To keep the argument count down, the SurfaceFlinger factory argument to the constructor was moved to be stored in the new Config structure. As a result of the change, SurfaceFlinger now only has one constructor. The tests were using the other constructor (passing SurfaceFlinger::skipInitiailization) to skip over the property reads to help ensure a hermetic configuration of SurfaceFlinger. The tests can now instead create create a minimally configured Config structure, and pass that the structure. The other changes were then to switch over to using the values in the Config structure, both internally to SurfaceFlinger, as well as in other files including Layer.cpp and DisplayDevice.cpp. In some cases, those changes required altering the arguments to the function being called to obtain the values, since originally some of the values where static member data in SurfaceFlinger. There were similar changes required for the tests and the fuzzers, to switch over, including how some tests mutated the configuration values so that they overall coverage was the same. No new tests/fuzzing was added, though it should now be easier to extend coverage. Test: atest libsurfaceflinger_unittest Bug: None Change-Id: I8dc3c2317a92b256e58ec45190e24463032c2f8e
Loading
Please register or sign in to comment