merge in jb-mr1-release history after reset to jb-mr1-dev
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index be4af51..d9bda11 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -696,6 +696,7 @@
free(dd.list);
dd.list = NULL;
dd.framebufferTarget = NULL; // points into dd.list
+ dd.fbTargetHandle = NULL;
}
}
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 17c67f9..492d1cf 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -772,8 +772,7 @@
}
setTransactionFlags(eDisplayTransactionNeeded);
- // we should only receive DisplayDevice::DisplayType from the vsync callback
- mEventThread->onHotplugReceived(type, connected);
+ // Defer EventThread notification until SF has updated mDisplays.
}
}
@@ -1130,6 +1129,7 @@
DisplayDevice::makeCurrent(mEGLDisplay, hw, mEGLContext);
mDisplays.removeItem(draw.keyAt(i));
getHwComposer().disconnectDisplay(draw[i].type);
+ mEventThread->onHotplugReceived(draw[i].type, false);
} else {
ALOGW("trying to remove the main display");
}
@@ -1212,6 +1212,7 @@
state.viewport, state.frame);
hw->setDisplayName(state.displayName);
mDisplays.add(display, hw);
+ mEventThread->onHotplugReceived(state.type, true);
}
}
}