Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit deb4c772 authored by Sharvil Nanavati's avatar Sharvil Nanavati Committed by Android Git Automerger
Browse files

am 2a459265: Fix low volume on Nemo devices after accepting incoming HFP call.

* commit '2a459265':
  Fix low volume on Nemo devices after accepting incoming HFP call.
parents 66728b30 2a459265
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2069,6 +2069,11 @@ final class HeadsetClientStateMachine extends StateMachine {
                            + currMode + " to " + newAudioMode);
                         mAudioManager.setMode(newAudioMode);
                    }

                    // We need to set the volume after switching into HFP mode as some Audio HALs
                    // reset the volume to a known-default on mode switch.
                    final int volume =
                            mAudioManager.getStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO);
                    Log.d(TAG,"hfp_enable=true");
                    Log.d(TAG,"mAudioWbs is " + mAudioWbs);
                    if (mAudioWbs) {
@@ -2080,6 +2085,7 @@ final class HeadsetClientStateMachine extends StateMachine {
                        mAudioManager.setParameters("hfp_set_sampling_rate=8000");
                    }
                    mAudioManager.setParameters("hfp_enable=true");
                    mAudioManager.setParameters("hfp_volume=" + volume);
                    broadcastAudioState(device, BluetoothHeadsetClient.STATE_AUDIO_CONNECTED,
                            BluetoothHeadsetClient.STATE_AUDIO_CONNECTING);
                    transitionTo(mAudioOn);