I have an android device acting as a hands free client device using hfp.
Using the following code:
I am able to receive a call and the speakers and mic are work
Could you please try below. I did not try myself but sounds similar problem if I understand correctly:
Android Bluetooth Earpiece Volume
"Android is using int 6 for bluetooth volume and not documented. Just use 6 instead of AudioManager.STREAM_VOICE_CALL and try, It should work"
I assume for you will be to replace AudioManager.STREAM_BLUETOOTH_SCO with 6.
Good luck, I hope it will work.