@qusaieilouti99/call-manager 0.1.161 → 0.1.162
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.
|
@@ -27,7 +27,6 @@ class MyConnection(
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
private var lastAudioState: CallAudioState? = null
|
|
30
|
-
// FIX: We must store the list of available endpoints when the system gives it to us.
|
|
31
30
|
private var availableCallEndpoints: List<CallEndpoint> = emptyList()
|
|
32
31
|
|
|
33
32
|
init {
|
|
@@ -49,7 +48,6 @@ class MyConnection(
|
|
|
49
48
|
Log.d(TAG, "MyConnection for callId $callId created and added to CallEngine. Type: $callType")
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
// FIX: Override the callback to receive endpoint updates from the system.
|
|
53
51
|
@RequiresApi(Build.VERSION_CODES.P)
|
|
54
52
|
override fun onAvailableCallEndpointsChanged(endpoints: List<CallEndpoint>) {
|
|
55
53
|
super.onAvailableCallEndpointsChanged(endpoints)
|
|
@@ -141,7 +139,7 @@ class MyConnection(
|
|
|
141
139
|
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
|
142
140
|
private fun requestCallEndpointChange(route: Int) {
|
|
143
141
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
|
144
|
-
return
|
|
142
|
+
return
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
val endpointType = when (route) {
|
|
@@ -155,11 +153,12 @@ class MyConnection(
|
|
|
155
153
|
}
|
|
156
154
|
}
|
|
157
155
|
|
|
158
|
-
// FIX: Use the
|
|
159
|
-
val targetEndpoint = this.availableCallEndpoints.find { it.
|
|
156
|
+
// FIX: Use the correct getter `getEndpointType()` instead of the non-existent property `type`.
|
|
157
|
+
val targetEndpoint = this.availableCallEndpoints.find { it.getEndpointType() == endpointType }
|
|
160
158
|
|
|
161
159
|
if (targetEndpoint != null) {
|
|
162
|
-
|
|
160
|
+
// FIX: Use the correct getter `getName()` instead of the non-existent property `name`.
|
|
161
|
+
Log.d(TAG, "Requesting CallEndpoint change to: ${targetEndpoint.getName()} (Type: $endpointType)")
|
|
163
162
|
requestCallEndpointChange(targetEndpoint, context.mainExecutor, object : OutcomeReceiver<Void, CallEndpointException> {
|
|
164
163
|
override fun onResult(result: Void?) {
|
|
165
164
|
Log.d(TAG, "CallEndpoint change request successful.")
|