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

Commit 5ae340f7 authored by Dan Stoza's avatar Dan Stoza Committed by Android Git Automerger
Browse files

am 0af1e0fe: Merge "Add hotplug support for primary display."

* commit '0af1e0fe':
  Add hotplug support for primary display.
parents 38f09a6e 0af1e0fe
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -305,14 +305,17 @@ void HWComposer::vsync(int disp, int64_t timestamp) {
}

void HWComposer::hotplug(int disp, int connected) {
    if (disp == HWC_DISPLAY_PRIMARY || disp >= VIRTUAL_DISPLAY_ID_BASE) {
    if (disp >= VIRTUAL_DISPLAY_ID_BASE) {
        ALOGE("hotplug event received for invalid display: disp=%d connected=%d",
                disp, connected);
        return;
    }
    queryDisplayProperties(disp);
    // Do not teardown or recreate the primary display
    if (disp != HWC_DISPLAY_PRIMARY) {
        mEventHandler.onHotplugReceived(disp, bool(connected));
    }
}

static float getDefaultDensity(uint32_t width, uint32_t height) {
    // Default density is based on TVs: 1080p displays get XHIGH density,