summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-10-02 18:12:30 -0700
committer Mathias Agopian <mathias@google.com> 2009-10-02 18:12:30 -0700
commit0c4cec7e4df87181486d280c98fba9c0f4774c37 (patch)
tree4d3aa4fe0101104a1816af9208d367d588bb4f4d /libs/surfaceflinger/SurfaceFlinger.cpp
parent7b16834adc1003f492cd2be4b1bcc3fb73a78c23 (diff)
Attempt to fix [2152536] ANR in browser
The ANR is caused by SurfaceFlinger waiting for buffers of a removed surface to become availlable. When it is removed from the current list, a Surface is marked as NO_INIT, which causes SF to return immediately in the above case. For some reason, the surface here wasn't marked as NO_INIT. This change makes the code more robust by always (irregadless or errors) setting the NO_INIT status in all code paths where a surface is removed from the list. Additionaly added more information in the logs, should this happen again.
Diffstat (limited to 'libs/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index eb0983ab58f4..f2b918fa2a1c 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -1073,6 +1073,8 @@ status_t SurfaceFlinger::purgatorizeLayer_l(const sp<LayerBase>& layerBase)
// remove the layer from the main list (through a transaction).
ssize_t err = removeLayer_l(layerBase);
+ layerBase->onRemoved();
+
// it's possible that we don't find a layer, because it might
// have been destroyed already -- this is not technically an error
// from the user because there is a race between BClient::destroySurface(),
@@ -1321,7 +1323,6 @@ status_t SurfaceFlinger::removeSurface(SurfaceID index)
if (layer != 0) {
err = purgatorizeLayer_l(layer);
if (err == NO_ERROR) {
- layer->onRemoved();
setTransactionFlags(eTransactionNeeded);
}
}