diff options
author | Ricardo Garcia <rago@google.com> | 2014-07-25 15:08:24 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-24 22:43:15 +0000 |
commit | 0a234ea24a9b03da571150c464c6670fba9d224f (patch) | |
tree | 0fdceea0bb73dd785f2e0ac258867fa479a9e1cc | |
parent | 319b09d0cf6ae5bc21d8fd1e14e7a9df915514cf (diff) | |
parent | 05f2fdc1070c1c07af9e21760d4d2e06bebde55a (diff) | |
download | frameworks_av-0a234ea24a9b03da571150c464c6670fba9d224f.zip frameworks_av-0a234ea24a9b03da571150c464c6670fba9d224f.tar.gz frameworks_av-0a234ea24a9b03da571150c464c6670fba9d224f.tar.bz2 |
Merge "-Making sure mAudioCommands list is empty before going to sleep. -Wake_lock release before sleeping or quitting threadLoop()." into lmp-dev
-rw-r--r-- | services/audiopolicy/AudioPolicyService.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/AudioPolicyService.cpp index ae9cc35..7f14960 100644 --- a/services/audiopolicy/AudioPolicyService.cpp +++ b/services/audiopolicy/AudioPolicyService.cpp @@ -514,21 +514,23 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() break; } } - // release delayed commands wake lock - if (mAudioCommands.isEmpty()) { - release_wake_lock(mName.string()); - } // release mLock before releasing strong reference on the service as // AudioPolicyService destructor calls AudioCommandThread::exit() which acquires mLock. mLock.unlock(); svc.clear(); mLock.lock(); - if (!exitPending()) { + if (!exitPending() && mAudioCommands.isEmpty()) { + // release delayed commands wake lock + release_wake_lock(mName.string()); ALOGV("AudioCommandThread() going to sleep"); mWaitWorkCV.waitRelative(mLock, waitTime); ALOGV("AudioCommandThread() waking up"); } } + // release delayed commands wake lock before quitting + if (!mAudioCommands.isEmpty()) { + release_wake_lock(mName.string()); + } mLock.unlock(); return false; } |