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

@ -8,8 +8,8 @@ android {
applicationId = 'com.tutpro.baresip'
minSdkVersion 21
targetSdkVersion 26
versionCode = 11
versionName = '2.1.1'
versionCode = 12
versionName = '2.1.2'
externalNativeBuild {
cmake {
cFlags '-DHAVE_INTTYPES_H'

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]