diff options
author | Eric Laurent <elaurent@google.com> | 2014-12-16 19:39:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-12-16 19:39:25 +0000 |
commit | 09a1f34f2f45fe01b7dc6a15b15259ba61e47b5b (patch) | |
tree | 64844831c1ca63bf67b8732e575a8250cff3441e /services/audiopolicy | |
parent | ac90a24da56ff575220aefd3f3be1fbe2f9111ba (diff) | |
parent | 8faa3262f367f8f10ff310ac3c097b860ba9cc3e (diff) | |
download | frameworks_av-09a1f34f2f45fe01b7dc6a15b15259ba61e47b5b.zip frameworks_av-09a1f34f2f45fe01b7dc6a15b15259ba61e47b5b.tar.gz frameworks_av-09a1f34f2f45fe01b7dc6a15b15259ba61e47b5b.tar.bz2 |
Merge "DO NOT MERGE - audio policy: fix inifinite loop in clearAudioPatches()"
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 536987a..3e1506d 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -2561,13 +2561,10 @@ status_t AudioPolicyManager::setAudioPortConfig(const struct audio_port_config * void AudioPolicyManager::clearAudioPatches(uid_t uid) { - for (ssize_t i = 0; i < (ssize_t)mAudioPatches.size(); i++) { + for (ssize_t i = (ssize_t)mAudioPatches.size() - 1; i >= 0; i--) { sp<AudioPatch> patchDesc = mAudioPatches.valueAt(i); if (patchDesc->mUid == uid) { - // releaseAudioPatch() removes the patch from mAudioPatches - if (releaseAudioPatch(mAudioPatches.keyAt(i), uid) == NO_ERROR) { - i--; - } + releaseAudioPatch(mAudioPatches.keyAt(i), uid); } } } |