Differentiate between mute reported to AS and port mute
The audio tracks now store the mute by port property which will be sent
to AS together with all the other mute properties. When changing the
muted by port we need to check whether the new muteState has changed.
This is why it is easier to have both properties stored within the
native tracks.
Test: atest AudioPlaybackConfigurationTest
Flag: EXEMPT bugfix
Bug: 374483735
Change-Id: Iba3153f13762bad3f055b0f69cf490e2ccff6d88
diff --git a/services/audioflinger/MmapTracks.h b/services/audioflinger/MmapTracks.h
index 30bbd5d..0210bc2 100644
--- a/services/audioflinger/MmapTracks.h
+++ b/services/audioflinger/MmapTracks.h
@@ -73,10 +73,10 @@
mVolume = volume;
}
void setPortMute(bool muted) override {
- mMuteState.muteFromPortVolume = muted;
+ mMutedFromPort = muted;
}
float getPortVolume() const override { return mVolume; }
- bool getPortMute() const override { return mMuteState.muteFromPortVolume; }
+ bool getPortMute() const override { return mMutedFromPort; }
private:
DISALLOW_COPY_AND_ASSIGN(MmapTrack);
@@ -101,6 +101,7 @@
/* GUARDED_BY(MmapPlaybackThread::mLock) */;
mute_state_t mMuteState
/* GUARDED_BY(MmapPlaybackThread::mLock) */;
+ bool mMutedFromPort;
float mVolume = 0.0f;
}; // end of Track