summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-09-20 21:28:12 -0700
committerMathias Agopian <mathias@google.com>2012-09-20 21:28:12 -0700
commit4c0751a1f6e4ee941791012b31f9dbc65601e1d6 (patch)
tree728034cbfb2509fa9d3bdc2347e64a846a4b7014 /services
parent38e623bc5c2d7224ebd5b82efaea401bc8e5367a (diff)
downloadframeworks_native-4c0751a1f6e4ee941791012b31f9dbc65601e1d6.zip
frameworks_native-4c0751a1f6e4ee941791012b31f9dbc65601e1d6.tar.gz
frameworks_native-4c0751a1f6e4ee941791012b31f9dbc65601e1d6.tar.bz2
return an error, as expected, when querying a disconnected display
Change-Id: I405a3a7bb42b9bbd2ec7bfe09e60e1b7acf7389d
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0ce5266..8164d20 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -536,6 +536,10 @@ status_t SurfaceFlinger::getDisplayInfo(const sp<IBinder>& display, DisplayInfo*
}
const HWComposer& hwc(getHwComposer());
+ if (!hwc.isConnected(type)) {
+ return NAME_NOT_FOUND;
+ }
+
float xdpi = hwc.getDpiX(type);
float ydpi = hwc.getDpiY(type);