From 4c0751a1f6e4ee941791012b31f9dbc65601e1d6 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 20 Sep 2012 21:28:12 -0700 Subject: [PATCH] return an error, as expected, when querying a disconnected display Change-Id: I405a3a7bb42b9bbd2ec7bfe09e60e1b7acf7389d --- services/surfaceflinger/SurfaceFlinger.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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);