@qusaieilouti99/call-manager 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,6 +20,7 @@ class CallActivity : Activity() {
|
|
|
20
20
|
|
|
21
21
|
// Cancel the notification as soon as CallActivity is shown
|
|
22
22
|
CallEngine.cancelIncomingCallUI(this)
|
|
23
|
+
CallEngine.playRingtone(this)
|
|
23
24
|
|
|
24
25
|
val callerName = intent.getStringExtra("callerName") ?: "Unknown"
|
|
25
26
|
val nameView = findViewById<TextView>(R.id.caller_name)
|
|
@@ -43,6 +44,7 @@ class CallActivity : Activity() {
|
|
|
43
44
|
|
|
44
45
|
override fun onDestroy() {
|
|
45
46
|
super.onDestroy()
|
|
47
|
+
CallEngine.stopRingtone()
|
|
46
48
|
CallEngine.cancelIncomingCallUI(this)
|
|
47
49
|
CallEngine.stopForegroundService(this)
|
|
48
50
|
CallEngine.disconnectTelecomCall(this, intent.getStringExtra("callId") ?: "")
|
|
@@ -12,6 +12,7 @@ import android.telecom.PhoneAccount
|
|
|
12
12
|
import android.telecom.PhoneAccountHandle
|
|
13
13
|
import android.telecom.TelecomManager
|
|
14
14
|
import android.util.Log
|
|
15
|
+
import android.graphics.Color
|
|
15
16
|
import android.app.Person
|
|
16
17
|
|
|
17
18
|
object CallEngine {
|
|
@@ -64,7 +65,7 @@ object CallEngine {
|
|
|
64
65
|
val declinePendingIntent = PendingIntent.getBroadcast(context, 1, declineIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
|
|
65
66
|
|
|
66
67
|
val fullScreenIntent = Intent(context, CallActivity::class.java).apply {
|
|
67
|
-
addFlags(Intent.
|
|
68
|
+
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
68
69
|
putExtra("callId", callId)
|
|
69
70
|
putExtra("callerName", callerName)
|
|
70
71
|
}
|
|
@@ -95,7 +96,6 @@ object CallEngine {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
notificationManager.notify(NOTIF_ID, notification)
|
|
98
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) playRingtone(context)
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
fun cancelIncomingCallUI(context: Context) {
|