Fix locking for mMasterVolume and mMute
mMasterVolume and mMute are both protected by mutex in AudioFlinger class, but
there were two places where they were accessed without a mutex.
Also make AudioFlinger::mMasterMute private not protected.
Change-Id: Ia3897daeb5c50313df5bcc071824357526237f3e
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index f99e764..d22de26 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -765,7 +765,9 @@
int16_t* mMixBuffer;
int mSuspended;
int mBytesWritten;
+ private:
bool mMasterMute;
+ protected:
SortedVector< wp<Track> > mActiveTracks;
virtual int getTrackName_l() = 0;
@@ -1388,6 +1390,8 @@
DefaultKeyedVector< int, sp<PlaybackThread> > mPlaybackThreads;
PlaybackThread::stream_type_t mStreamTypes[AUDIO_STREAM_CNT];
+
+ // both are protected by mLock
float mMasterVolume;
bool mMasterMute;
@@ -1399,6 +1403,9 @@
bool mBtNrecIsOff;
Vector<AudioSessionRef*> mAudioSessionRefs;
+
+ float masterVolume_l() const { return mMasterVolume; }
+ bool masterMute_l() const { return mMasterMute; }
};