Audiomanager Speaker not working

I’m trying to enable the speaker while I am in a call:

final AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);

I tried to check after the setSpeakerphoneOn() the audiomanager and get that the speaker is still not on by asking isSpeakerphoneOn()


In my log I can see some errors that I can’t understand:

E/AudioManager: Don't setBluetoothScoOn-PackageName:  on = false
E/AudioManager: Don't setSpeakerphoneOn-PackageName:  on = true

I can’t find anything about this error in the forum.

Didn’t work on devices: ZTE Z981, Huawei p9, I already tried this, and android.permission.MODIFY_AUDIO_SETTINGS is granted.


I found that setMode() (the current mode) before setSpeakerphoneOn() fixes the error on the logcat:

AudioManager audioManager = (AudioManager)getApplicationContext().getSystemService(Context.AUDIO_SERVICE); 

Leave a Reply

Your email address will not be published. Required fields are marked *