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

Commit 9cf9e51c authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Log hotplug events

When debugging hotplug related issues it is very useful to have
hotplug events in the logs. These events occur rarely so the
overhead of this additional log is low.

Bug: 174644816
Test: adb logcat | grep onHotplug
Change-Id: If1383a4dea2e95060fa3c4332406b80fc42af40c
parent 1876e2ea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1618,7 +1618,7 @@ void SurfaceFlinger::changeRefreshRateLocked(const RefreshRate& refreshRate,

void SurfaceFlinger::onHotplugReceived(int32_t sequenceId, hal::HWDisplayId hwcDisplayId,
                                       hal::Connection connection) {
    ALOGV("%s(%d, %" PRIu64 ", %s)", __FUNCTION__, sequenceId, hwcDisplayId,
    ALOGI("%s(%d, %" PRIu64 ", %s)", __FUNCTION__, sequenceId, hwcDisplayId,
          connection == hal::Connection::CONNECTED ? "connected" : "disconnected");

    // Ignore events that do not have the right sequenceId.
@@ -2385,6 +2385,8 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
}

void SurfaceFlinger::dispatchDisplayHotplugEvent(PhysicalDisplayId displayId, bool connected) {
    ALOGI("Dispatching display hotplug event displayId=%s, connected=%d",
          to_string(displayId).c_str(), connected);
    mScheduler->onHotplugReceived(mAppConnectionHandle, displayId, connected);
    mScheduler->onHotplugReceived(mSfConnectionHandle, displayId, connected);
}