From 248b5bd51e325107f8119b564db6a06ac51c232a Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 10 Sep 2009 19:41:18 -0700 Subject: fix [2112575] stuck on DequeueCondition for a surface that doesn't exist anymore this also fixes part of [2111536] Device is soft rebooted after ending the call through voice dialer --- libs/ui/SharedBufferStack.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libs/ui/SharedBufferStack.cpp') diff --git a/libs/ui/SharedBufferStack.cpp b/libs/ui/SharedBufferStack.cpp index 73fb582f9c3e..3fbd8c7ae34e 100644 --- a/libs/ui/SharedBufferStack.cpp +++ b/libs/ui/SharedBufferStack.cpp @@ -53,21 +53,20 @@ uint32_t SharedClient::getIdentity(size_t token) const { return uint32_t(surfaces[token].identity); } -status_t SharedClient::setIdentity(size_t token, uint32_t identity) { - if (token >= NUM_LAYERS_MAX) - return BAD_INDEX; - surfaces[token].identity = identity; - return NO_ERROR; -} - // ---------------------------------------------------------------------------- SharedBufferStack::SharedBufferStack() - : inUse(-1), status(NO_ERROR), identity(-1) { } +void SharedBufferStack::init(int32_t i) +{ + inUse = -1; + status = NO_ERROR; + identity = i; +} + status_t SharedBufferStack::setDirtyRegion(int buffer, const Region& dirty) { if (uint32_t(buffer) >= NUM_BUFFER_MAX) @@ -312,9 +311,10 @@ status_t SharedBufferClient::setDirtyRegion(int buffer, const Region& reg) // ---------------------------------------------------------------------------- SharedBufferServer::SharedBufferServer(SharedClient* sharedClient, - int surface, int num) + int surface, int num, int32_t identity) : SharedBufferBase(sharedClient, surface, num) { + mSharedStack->init(identity); mSharedStack->head = num-1; mSharedStack->available = num; mSharedStack->queued = 0; -- cgit v1.2.3-59-g8ed1b