Skip to content

Commit

Permalink
(audiocall) AudioCallManager classes renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
jedi1150 committed Jan 15, 2024
1 parent ff4665f commit ba8a584
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import androidx.lifecycle.OnLifecycleEvent
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.multidex.MultiDexApplication
import com.google.firebase.FirebaseApp
import com.voximplant.demos.kotlin.audio_call.services.AudioCallManagerBase
import com.voximplant.demos.kotlin.audio_call.services.AudioCallManagerDefault
import com.voximplant.demos.kotlin.audio_call.services.AudioCallManager
import com.voximplant.demos.kotlin.audio_call.services.AudioCallManagerWithTelecom
import com.voximplant.demos.kotlin.audio_call.services.AudioCallManagerTelecom
import com.voximplant.demos.kotlin.services.AuthService
import com.voximplant.demos.kotlin.utils.*
import com.voximplant.sdk.Voximplant
Expand Down Expand Up @@ -62,9 +62,9 @@ class AudioCallApplication : MultiDexApplication(), LifecycleObserver {
Shared.fileLogger = FileLogger(this)
Shared.authService = AuthService(client, applicationContext)
audioCallManager = if (applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_TELECOM)) {
AudioCallManagerWithTelecom(applicationContext, client)
AudioCallManagerTelecom(applicationContext, client)
} else {
AudioCallManagerBase(applicationContext, client)
AudioCallManagerDefault(applicationContext, client)
}
Shared.shareHelper = ShareHelper.also {
it.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.voximplant.sdk.call.*
import com.voximplant.sdk.client.IClient
import java.util.*

class AudioCallManagerBase(
class AudioCallManagerDefault(
context: Context,
client: IClient,
) : AudioCallManager(context, client) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.voximplant.sdk.call.*
import com.voximplant.sdk.client.IClient
import java.util.*

class AudioCallManagerWithTelecom(
class AudioCallManagerTelecom(
context: Context,
client: IClient,
) : AudioCallManager(context, client) {
Expand All @@ -23,15 +23,15 @@ class AudioCallManagerWithTelecom(
private var managedCallConnection: CallConnection? = null

fun createIncomingConnection(): CallConnection? {
Log.i(APP_TAG, "AudioCallManagerWithTelecom::createIncomingConnection")
Log.i(APP_TAG, "AudioCallManagerTelecom::createIncomingConnection")
managedCallConnection = CallConnection()
managedCallConnection?.setInitialized()
audioDeviceManager.setTelecomConnection(managedCallConnection)
return managedCallConnection
}

fun createOutgoingConnection(): CallConnection? {
Log.i(APP_TAG, "AudioCallManagerWithTelecom::createOutgoingConnection")
Log.i(APP_TAG, "AudioCallManagerTelecom::createOutgoingConnection")
managedCallConnection = CallConnection()
managedCallConnection?.setInitialized()
audioDeviceManager.setTelecomConnection(managedCallConnection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CallConnectionService : ConnectionService() {
connectionManagerPhoneAccount: PhoneAccountHandle?, request: ConnectionRequest?
): Connection? {
Log.i(APP_TAG, "CallConnectionService::onCreateIncomingConnection $request")
return if (audioCallManager is AudioCallManagerWithTelecom) {
(audioCallManager as AudioCallManagerWithTelecom).createIncomingConnection()?.apply {
return if (audioCallManager is AudioCallManagerTelecom) {
(audioCallManager as AudioCallManagerTelecom).createIncomingConnection()?.apply {
setRinging()
}
} else {
Expand All @@ -40,8 +40,8 @@ class CallConnectionService : ConnectionService() {
request: ConnectionRequest?,
): Connection? {
Log.i(APP_TAG, "CallConnectionService::onCreateOutgoingConnection $request")
return if (audioCallManager is AudioCallManagerWithTelecom) {
(audioCallManager as AudioCallManagerWithTelecom).createOutgoingConnection()
return if (audioCallManager is AudioCallManagerTelecom) {
(audioCallManager as AudioCallManagerTelecom).createOutgoingConnection()
} else {
return null
}
Expand Down

0 comments on commit ba8a584

Please sign in to comment.