summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-10-02 18:12:30 -0700
committerMathias Agopian <mathias@google.com>2009-10-02 18:12:30 -0700
commit0c4cec7e4df87181486d280c98fba9c0f4774c37 (patch)
tree4d3aa4fe0101104a1816af9208d367d588bb4f4d /include/private
parent7b16834adc1003f492cd2be4b1bcc3fb73a78c23 (diff)
downloadframeworks_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 'include/private')
-rw-r--r--include/private/ui/SharedBufferStack.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/private/ui/SharedBufferStack.h b/include/private/ui/SharedBufferStack.h
index c02b2e7..59cf31c 100644
--- a/include/private/ui/SharedBufferStack.h
+++ b/include/private/ui/SharedBufferStack.h
@@ -142,6 +142,7 @@ public:
SharedBufferBase(SharedClient* sharedClient, int surface, int num);
~SharedBufferBase();
uint32_t getIdentity();
+ status_t getStatus() const;
size_t getFrontBuffer() const;
String8 dump(char const* prefix) const;
@@ -177,7 +178,7 @@ status_t SharedBufferBase::waitForCondition(T condition)
{
const SharedBufferStack& stack( *mSharedStack );
SharedClient& client( *mSharedClient );
- const nsecs_t TIMEOUT = s2ns(1);
+ const nsecs_t TIMEOUT = s2ns(1);
Mutex::Autolock _l(client.lock);
while ((condition()==false) && (stack.status == NO_ERROR)) {
status_t err = client.cv.waitRelative(client.lock, TIMEOUT);
@@ -187,14 +188,15 @@ status_t SharedBufferBase::waitForCondition(T condition)
if (err == TIMED_OUT) {
if (condition()) {
LOGE("waitForCondition(%s) timed out (identity=%d), "
- "but condition is true! We recovered but it "
- "shouldn't happen." ,
- T::name(), mSharedStack->identity);
+ "but condition is true! We recovered but it "
+ "shouldn't happen." , T::name(),
+ mSharedStack->identity);
break;
} else {
- LOGW("waitForCondition(%s) timed out (identity=%d). "
- "CPU may be pegged. trying again.",
- T::name(), mSharedStack->identity);
+ LOGW("waitForCondition(%s) timed out "
+ "(identity=%d, status=%d). "
+ "CPU may be pegged. trying again.", T::name(),
+ mSharedStack->identity, mSharedStack->status);
}
} else {
LOGE("waitForCondition(%s) error (%s) ",