Add playback mute notifications for mmap tracks
Added the portId callback to the aaudio client which is registering it
with the AudioService similar to the AudioTrack clients logic.
MMap tracks have a different way of computing the volume. Some volume
components are computed in the aaudioservice. Note that AppOps mute,
client mute and volume shaper mute are not available for AAudio MMap tracks.
Test: dumpsys audio
Bug: 235521198
Change-Id: I05edaa6646cd21647f1602c1ce695be2233a08fc
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 745dbf2..71c24f3 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -10465,6 +10465,14 @@
}
for (const sp<MmapTrack> &track : mActiveTracks) {
track->setMetadataHasChanged();
+ track->processMuteEvent_l(mAudioFlinger->getOrCreateAudioManager(),
+ /*muteState=*/{mMasterMute,
+ mStreamVolume == 0.f,
+ mStreamMute,
+ // TODO(b/241533526): adjust logic to include mute from AppOps
+ false /*muteFromPlaybackRestricted*/,
+ false /*muteFromClientVolume*/,
+ false /*muteFromVolumeShaper*/});
}
}
}