diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 0ce526637..8164d2034 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -536,6 +536,10 @@ status_t SurfaceFlinger::getDisplayInfo(const sp& display, DisplayInfo* } const HWComposer& hwc(getHwComposer()); + if (!hwc.isConnected(type)) { + return NAME_NOT_FOUND; + } + float xdpi = hwc.getDpiX(type); float ydpi = hwc.getDpiY(type);