diff options
author | Mathias Agopian <mathias@google.com> | 2011-11-07 21:58:03 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-11-07 21:58:03 -0800 |
commit | 386aa98c4ffb9b805303e683f0a7b925b44d04db (patch) | |
tree | f71d89207d5dab4574ea0002b0441047761b1679 /services | |
parent | a5f9676eccbb3ac03f737a22c7a99ee1895a7f6f (diff) | |
download | frameworks_native-386aa98c4ffb9b805303e683f0a7b925b44d04db.zip frameworks_native-386aa98c4ffb9b805303e683f0a7b925b44d04db.tar.gz frameworks_native-386aa98c4ffb9b805303e683f0a7b925b44d04db.tar.bz2 |
Fix an issue where we could wait for a non-existing transaction
This fixes the issue:
"Call not sent" dialog takes too long to dismiss after hitting OK"
Note: the system would recover after a 5 second timeout.
Bug: 5534520
Change-Id: Ifa37e594b50581f498479a5858672441b3d7dd87
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 8f4fdb8..1b00e93 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1217,23 +1217,25 @@ void SurfaceFlinger::setTransactionState(const Vector<ComposerState>& state, sp<Client> client( static_cast<Client *>(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } + if (transactionFlags) { + // this triggers the transaction setTransactionFlags(transactionFlags); - } - // if this is a synchronous transaction, wait for it to take effect before - // returning. - if (flags & eSynchronous) { - mTransationPending = true; - } - while (mTransationPending) { - status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); - if (CC_UNLIKELY(err != NO_ERROR)) { - // just in case something goes wrong in SF, return to the - // called after a few seconds. - LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!"); - mTransationPending = false; - break; + // if this is a synchronous transaction, wait for it to take effect + // before returning. + if (flags & eSynchronous) { + mTransationPending = true; + } + while (mTransationPending) { + status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); + if (CC_UNLIKELY(err != NO_ERROR)) { + // just in case something goes wrong in SF, return to the + // called after a few seconds. + LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!"); + mTransationPending = false; + break; + } } } } |