- Improved asking of permissions and acting on the answers.

This commit is contained in:
Juha Heinanen
2019-11-15 15:11:41 +02:00
parent 5c5603f2b3
commit d3162b82ed
10 changed files with 108 additions and 51 deletions
@@ -529,7 +529,10 @@ class BaresipService: Service() {
}
"call incoming" -> {
val peerUri = Api.call_peeruri(callp)
if ((Call.calls().size > 0) || (tm.callState != TelephonyManager.CALL_STATE_IDLE)) {
if ((Call.calls().size > 0) ||
(tm.callState != TelephonyManager.CALL_STATE_IDLE) ||
!Utils.checkPermission(applicationContext,
android.Manifest.permission.RECORD_AUDIO)) {
Log.d(LOG_TAG, "Auto-rejecting incoming call $uap/$callp/$peerUri")
Api.ua_hangup(uap, callp, 486, "Busy Here")
if (ua.account.callHistory) {