diff options
author | Eric Laurent <elaurent@google.com> | 2013-09-23 12:08:05 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-09-23 12:38:11 -0700 |
commit | 21e5456821e3c107d09b0629adbf23c9e06e7c0b (patch) | |
tree | c2eef1ee9d591a96e88922b5061a861d8596c802 /services | |
parent | 4b701cc041d635e5ec56e382043a4c5d01aedd80 (diff) | |
download | frameworks_av-21e5456821e3c107d09b0629adbf23c9e06e7c0b.zip frameworks_av-21e5456821e3c107d09b0629adbf23c9e06e7c0b.tar.gz frameworks_av-21e5456821e3c107d09b0629adbf23c9e06e7c0b.tar.bz2 |
fix incoming call audio start time.
commit cec4abb fixing issue 6720482 had a flaw that
would insert commmands at the wrong position in the
audio policy service command thread queue causing other
commands to be delayed more than expected.
A change in track stop timing introduced by commit bfb1b83
made this issue visible when answering a call.
Bug: 10860012.
Change-Id: Iec769112f14e13d13b64628b808e43663e33771c
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioPolicyService.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index 4be292f..35e816b 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -975,7 +975,6 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(AudioCommand *comma { ssize_t i; // not size_t because i will count down to -1 Vector <AudioCommand *> removedCommands; - nsecs_t time = 0; command->mTime = systemTime() + milliseconds(delayMs); // acquire wake lock to make sure delayed commands are processed @@ -1021,7 +1020,10 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(AudioCommand *comma } else { data2->mKeyValuePairs = param2.toString(); } - time = command2->mTime; + command->mTime = command2->mTime; + // force delayMs to non 0 so that code below does not request to wait for + // command status as the command is now delayed + delayMs = 1; } break; case SET_VOLUME: { @@ -1032,7 +1034,10 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(AudioCommand *comma ALOGV("Filtering out volume command on output %d for stream %d", data->mIO, data->mStream); removedCommands.add(command2); - time = command2->mTime; + command->mTime = command2->mTime; + // force delayMs to non 0 so that code below does not request to wait for + // command status as the command is now delayed + delayMs = 1; } break; case START_TONE: case STOP_TONE: @@ -1054,16 +1059,12 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(AudioCommand *comma } removedCommands.clear(); - // wait for status only if delay is 0 and command time was not modified above - if (delayMs == 0 && time == 0) { + // wait for status only if delay is 0 + if (delayMs == 0) { command->mWaitStatus = true; } else { command->mWaitStatus = false; } - // update command time if modified above - if (time != 0) { - command->mTime = time; - } // insert command at the right place according to its time stamp ALOGV("inserting command: %d at index %d, num commands %d", |