summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2015-05-12 18:04:26 -0700
committerDan Stoza <stoza@google.com>2015-05-28 13:35:24 -0700
commitd74ba85c6f13bc1634ab1ae3c6c82d0fc837eb94 (patch)
treecc64cfd720e61d039b5cc372a7d26cbef67ddbcd /services/surfaceflinger
parent076d25b19d50bc71775b72ed95b1b49fb544100c (diff)
downloadframeworks_native-d74ba85c6f13bc1634ab1ae3c6c82d0fc837eb94.zip
frameworks_native-d74ba85c6f13bc1634ab1ae3c6c82d0fc837eb94.tar.gz
frameworks_native-d74ba85c6f13bc1634ab1ae3c6c82d0fc837eb94.tar.bz2
Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates it's display parameters but doesn't destroy or recreate the display. Bug: 18698244 Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702 (cherry picked from commit 10613dc3b565e95d3d5f459ec70fd2f6a77f807a)
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index c8b36ec..4e1b3ea 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -305,13 +305,16 @@ 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);
- mEventHandler.onHotplugReceived(disp, bool(connected));
+ // 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) {