The problem comes from the code handling the automatic change of audio routing to speaker when notifications are played. The music is also muted while the sound is forced to speaker.
To avoid truncating the end of the notification, a delay is inserted between the end of the notification and the restoration of the audio routing. If a new notification starts during this delay, the current music mute state read and saved before muting music corresponds to the forced mute due to previous notification. When the new notification ends, the mute state restored is muted and music stream stays muted for ever.
The fix consists in reading and saving music mute state only if the audio routing has been restored (check that mForcedRoute is back to 0).
This change is the first part of a fix for issue 1846343, :
- Added new enum values for input sources in AudioRecord and MediaRecorder for voice uplink, downlink and uplink+downlink sources.
- renamed streamType to inputSource in all native functions handling audio record.
A second change is required in opencore author driver and android audio input to completely fix the issue.
AudioTrack, AudioRecord:
- remove useless mAudioFlinger member of AudioTrack and AudioRecord.
- signal cblk.cv condition in stop() method to speed up stop completion.
- extend wait condition timeout in obtainBuffer() when waitCount is -1 to avoid waking up callback thread unnecessarily
AudioFlinger:
- remove some warnings in AudioFlinger.cpp.
- remove function AudioFlinger::MixerThread::removetrack_l() as its content is never executed.
- remove useless call to setMasterVolume in AudioFlinger::handleForcedSpeakerRoute().
- Offset VOICE_CALL stream volume to reflect actual volume that is never 0 in hardware (this fix has been made in the open source): 0.01 + v * 0.99.
AudioSystem.java:
- correct typo in comment
IAudioflinger, IAudioFlingerClient:
- make AudioFlinger binder interfaces used for callbacks ONEWAY.
AudioHardwareInterface:
- correct routeStrings[] table in AudioHardwareInteface.cpp
Take mutex in close(), and skip write path after turning bluetooth off.
Original author: npelly
Merged from: //branches/cupcake/...
Automated import of CL 144151
AudioFlinger::MixerThread::dumpTracks() was reading mTracks[] vector instead of mActiveTracks[] when dumping active tracks.
Original author: elaurent
Merged from: //branches/cupcake/...
Automated import of CL 143775
Current implementation of Camera service plays the camera shutter sound over the ALARM stream so that it cannot be muted by silent mode in order to comply to some country specific requirement. A recent change made it possible for the user to mute the ALARM stream thus making this stream not suitable any more for the camera shutter sound.
The fix consists in creating a new stream type only accessible by native code and that cannot be muted and use it to play camera sounds.
Original author: elaurent
Merged from: //branches/cupcake/...
Automated import of CL 143177