https://crrev.com/c/989214 adds some code to powerd's DBusWrapper class to make it possible for arbitrary classes to directly watch for D-Bus service name ownership changes.
At present, most D-Bus work gets done by the Daemon class. That class is huge and hard to test, and I should move its D-Bus code into other classes where possible.
Some D-Bus code will probably remain in Daemon, particularly for cases where multiple classes want to watch for the same signal.
Comment 1 by bugdroid1@chromium.org
, Apr 5 2018