Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
audiopolicy: do not set FM volume during device connection/disconnection
Volume inconsistencies are observed when a headset is
plugged in and out repeatedly while FM is active.

This is because the volume stored for stream music for the primary
output is first applied and then the FM volume for headset is applied.

Do not set volume as part of headset connection/disconnection to fix
the issue as it gets set as part of setOutputDevice anyway.

CRs-Fixed: 978396
Change-Id: Ibe0f3639ac4825330a710e86abc31d609136c924
  • Loading branch information
Satya Krishna Pindiproli authored and Gerrit - the friendly Code Review server committed Dec 13, 2016
1 parent b32ded3 commit b9308d9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions policy_hal/AudioPolicyManager.cpp
Expand Up @@ -321,9 +321,6 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d
mPrimaryOutput->changeRefCount(AUDIO_STREAM_MUSIC, -1);
}
AudioParameter param = AudioParameter();
float volumeDb = mPrimaryOutput->mCurVolume[AUDIO_STREAM_MUSIC];
mPrevFMVolumeDb = volumeDb;
param.addFloat(String8("fm_volume"), Volume::DbToAmpl(volumeDb));
param.addInt(String8("handle_fm"), (int)newDevice);
mpClientInterface->setParameters(mPrimaryOutput->mIoHandle, param.toString());
}
Expand Down

0 comments on commit b9308d9

Please sign in to comment.