turn off speaker when call is closed

This commit is contained in:
Juha Heinanen
2018-08-07 13:15:00 +03:00
parent 7950e0e146
commit c1e2edddad
2 changed files with 8 additions and 2 deletions

View File

@ -605,6 +605,12 @@ class MainActivity : AppCompatActivity() {
}
}
if (calls.size == 0) am.mode = AudioManager.MODE_NORMAL
if (am.isSpeakerphoneOn) {
am.isSpeakerphoneOn = false
val speakerIcon = findViewById(R.id.speakerIcon) as ActionMenuItemView
speakerIcon.setBackgroundColor(ContextCompat.getColor(applicationContext,
R.color.colorPrimary))
}
}
"message" -> {
val peer_uri = params[1]