title: Speaker not working during calls on Android 11
body: <p><strong>Problem:</strong></p>
  <p>I'm trying to enable speaker during a call, but the below code only works on Android 8,9 and Android 10. And in devices with Android 11, doesn't work.</p>
  <p>Does anyone know a solution that works on Android 11?</p>
  <p><strong>Code:</strong></p>
  <pre><code>private fun enableSpeaker() {
          audioManager?.let {
              if (!it.isSpeakerphoneOn) {
                  audioManager!!.mode = AudioManager.MODE_NORMAL
                  audioManager!!.mode = AudioManager.MODE_IN_COMMUNICATION
                  audioManager!!.isSpeakerphoneOn = true
              }
          }
  
      }
  
      private fun disableSpeaker() {
          audioManager?.let {
              if (it.isSpeakerphoneOn) {
                  audioManager!!.mode = AudioManager.MODE_NORMAL
                  audioManager!!.isSpeakerphoneOn = false
              }
          }
  
      }
  </code></pre>