Skip to content

Commit

Permalink
audio: list only actived tracks
Browse files Browse the repository at this point in the history
After the audio of an app is interrupted (such as an incoming call arrived when playing music), this app may not appear in the volume controller before force stop it.
This commit fixed the problem

Signed-off-by: cjybyjk <[email protected]>
Signed-off-by: NurKeinNeid <[email protected]>
  • Loading branch information
cjybyjk authored and NurKeinNeid committed May 12, 2021
1 parent 0b1c353 commit 4c602bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/audioflinger/Threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2410,13 +2410,13 @@ ssize_t AudioFlinger::PlaybackThread::Tracks<T>::remove(const sp<T> &track)
void AudioFlinger::PlaybackThread::listAppTrackDatas(std::set<AppTrackData> &cup)
{
Mutex::Autolock _l(mLock);
for (sp<Track> track : mTracks) {
for (sp<Track> track : mActiveTracks) {
if (!track->getPackageName().isEmpty()) {
AppTrackData av;
strcpy(av.packageName, track->getPackageName().c_str());
av.muted = track->isAppMuted();
av.volume = track->getAppVolume();
av.active = mActiveTracks.indexOf(track) >= 0;
av.active = true;
cup.insert(av);
}
}
Expand Down

0 comments on commit 4c602bc

Please sign in to comment.