Why is setStreamVolume not working for Vivo Android devices running Android 12?

193 Views Asked by At

AudioManager setStreamVolume api is not setting volume for Vivo devices running android 12 and above

I am trying the below code to set the stream volume of the device : Here streamType value is always 0 or 1 as I am using a video call/normal. Here convertedIndex ranges from 1 to 10. Flags i have tried different including AudioManager.STREAM_VOICECALL,AudioManager.STREAM_SYSTEM etc. Right now set as 0 as well. But still volume is not getting set. Made a check for isVolumeFixed before setting. audioManager?.setStreamVolume(streamType, convertedIndex, 0). Apart from setStreamVolume, tried below apis as well : adjustVolume adjustStreamVolume adjustSuggestedStreamVolume setVolumeIndexForAttributes

But none of the apis set volume for Vivo android devices. What could be the possible reason.

1

There are 1 best solutions below

1
user123 user On

you have to modify your system sound settings in developers option and try it again after rebooting the system .