diff options
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 |
commit | 0c4cec7e4df87181486d280c98fba9c0f4774c37 (patch) | |
tree | 4d3aa4fe0101104a1816af9208d367d588bb4f4d /libs/surfaceflinger/LayerBase.cpp | |
parent | 7b16834adc1003f492cd2be4b1bcc3fb73a78c23 (diff) | |
download | frameworks_base-0c4cec7e4df87181486d280c98fba9c0f4774c37.zip frameworks_base-0c4cec7e4df87181486d280c98fba9c0f4774c37.tar.gz frameworks_base-0c4cec7e4df87181486d280c98fba9c0f4774c37.tar.bz2 |
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/LayerBase.cpp')
-rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index d83c842..83814cc 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -690,6 +690,14 @@ sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const const_cast<LayerBaseClient *>(this)); } +// called with SurfaceFlinger::mStateLock as soon as the layer is entered +// in the purgatory list +void LayerBaseClient::onRemoved() +{ + // wake up the condition + lcblk->setStatus(NO_INIT); +} + // --------------------------------------------------------------------------- LayerBaseClient::Surface::Surface( @@ -700,7 +708,6 @@ LayerBaseClient::Surface::Surface( { } - LayerBaseClient::Surface::~Surface() { /* |