InCallService improvements
This commit is contained in:
@@ -1,10 +1,17 @@
|
|||||||
package com.tutpro.baresip
|
package com.tutpro.baresip
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.IBinder
|
||||||
import android.telecom.Call
|
import android.telecom.Call
|
||||||
import android.telecom.InCallService
|
import android.telecom.InCallService
|
||||||
|
|
||||||
class InCallService : InCallService() {
|
class InCallService : InCallService() {
|
||||||
|
|
||||||
|
override fun onBind(intent: Intent): IBinder? {
|
||||||
|
instance = this
|
||||||
|
return super.onBind(intent)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCallAdded(call: Call) {
|
override fun onCallAdded(call: Call) {
|
||||||
super.onCallAdded(call)
|
super.onCallAdded(call)
|
||||||
Log.d(TAG, "InCallService: Call added")
|
Log.d(TAG, "InCallService: Call added")
|
||||||
@@ -29,7 +36,13 @@ class InCallService : InCallService() {
|
|||||||
BaresipService.instance?.handleExternalCallRemoved(call)
|
BaresipService.instance?.handleExternalCallRemoved(call)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUnbind(intent: Intent?): Boolean {
|
||||||
|
instance = null
|
||||||
|
return super.onUnbind(intent)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "Baresip"
|
private const val TAG = "Baresip"
|
||||||
|
var instance: InCallService? = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user