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

Skip to content
Commit 05f9398f authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Refactor HWComposer::onHotplug()

Currently HWComposer::onHotplug() contains logic that is
executed when hotplug disconnect or connect event occurs.
However reading what exactly is done during e.g. hotplug
connect is hard, because the logic is spread between two
if statements and the function HWComposer::onHotplugConnect().
This change moves all hotplug connect logic to
HWComposer::onHotplugConnect() and all disconnect logic
to a new function HWComposer::onHotplugDisconnect().

Additionally this CLs refactors onHotplugConnect() which
is currently responsible for multiple concerns, which is
making the code hard to understand and reuse.

 - checking if the event should be ignored is moved to
   a new function shouldIgnoreHotplugConnect()
 - creating the necessary state for the new display is
   moved to a new function allocatePhysicalDisplay()

Some of the newly created functions will be directly reused
in following CLs.

Bug: 143451809
Test: m surfaceflinger
Test: atest libsurfaceflinger_unittest
Change-Id: Ib4dae2ce81e8cac176a56b6de787a4f76d01c050
parent 1581d90e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment