@qusaieilouti99/call-manager 0.1.22 → 0.1.24

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.
@@ -114,9 +114,16 @@ object CallEngine {
114
114
  }
115
115
 
116
116
  fun endAllCalls(context: Context) {
117
- Log.d(TAG, "endAllCalls")
117
+ if (activeCalls.isEmpty()) {
118
+ Log.d(TAG, "endAllCalls: No active calls, nothing to do.")
119
+ return
120
+ }
121
+ Log.d(TAG, "endAllCalls: Ending all active calls.")
118
122
  activeCalls.keys.toList().forEach { endCall(context, it) }
123
+ activeCalls.clear()
119
124
  currentCallId = null
125
+ cancelIncomingCallUI(context)
126
+ stopForegroundService(context)
120
127
  notifyCallStateChanged(context)
121
128
  }
122
129
 
@@ -209,7 +216,7 @@ object CallEngine {
209
216
 
210
217
  // --- Private helpers ---
211
218
 
212
- private fun playRingtone(context: Context) {
219
+ fun playRingtone(context: Context) {
213
220
  try {
214
221
  Log.d(TAG, "Playing ringtone")
215
222
  val uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
@@ -224,7 +231,7 @@ object CallEngine {
224
231
  }
225
232
  }
226
233
 
227
- private fun stopRingtone() {
234
+ fun stopRingtone() {
228
235
  try { ringtone?.stop() } catch (_: Exception) {}
229
236
  ringtone = null
230
237
  }
@@ -63,7 +63,7 @@ class CallManagerModule(reactContext: ReactApplicationContext) :
63
63
 
64
64
  // --- JSI-native audio/device/screen APIs ---
65
65
 
66
- override fun getAudioDevices(): ReadableArray {
66
+ override fun getAudioDevices(): WritableArray {
67
67
  val devices = CallEngine.getAudioDevices(reactApplicationContext)
68
68
  val array = Arguments.createArray()
69
69
  devices.forEach { array.pushString(it) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qusaieilouti99/call-manager",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "call manager",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",