There is a service in which I would like to realize the possibility of determining the current state of the phone’s sound during a phone call. Does the sound of a telephone conversation on the speaker or on the bluetooth headset. Looked in documentation that such functional gives InCallService in method getCallAudioState() . But how can I not figure out how to implement it?

  • stackoverflow.com/questions/9085978/ ... not that? - Andrey Kasyanov
  • For some reason I thought that AudioManager is only suitable for determining the sound output of music and the like. If I understand correctly in AudioManager there is no direct method that determines that the sound goes to the earpiece (not to the speakerphone). And in order to find out whether the sound is coming to him, you just need to check isBluetoothScoOn() , isSpeakerphoneOn() , isWiredHeadsetOn() (or the function replacing isWiredHeadsetOn() ) and if everything is false then the sound goes to the speaker of the phone for a conversation, and not on the speakerphone, right? Or is there a more elegant way? - Sergey Alexandrov

0