diff --git a/app/build.gradle b/app/build.gradle index 6e1b2a95..24bce93d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,13 +12,13 @@ def localProperties = new Properties() localProperties.load(new FileInputStream(rootProject.file("local.properties"))) android { - compileSdkVersion 33 + compileSdkVersion 34 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.telnyx.webrtc.sdk" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" @@ -120,9 +120,6 @@ dependencies { implementation deps.ktor.gson implementation deps.ktor.websockets - // Volley - implementation deps.volley - // Firebase implementation platform(deps.firebasebom) implementation deps.firebase_analytics diff --git a/app/src/main/java/com/telnyx/webrtc/sdk/ui/MainActivity.kt b/app/src/main/java/com/telnyx/webrtc/sdk/ui/MainActivity.kt index e2329a4e..af9729c7 100644 --- a/app/src/main/java/com/telnyx/webrtc/sdk/ui/MainActivity.kt +++ b/app/src/main/java/com/telnyx/webrtc/sdk/ui/MainActivity.kt @@ -225,6 +225,11 @@ class MainActivity : AppCompatActivity() { Timber.i("Loading...") } + override fun onChanged(value: SocketResponse) { + super.onChanged(value) + // Do Nothing + } + override fun onError(message: String?) { Timber.e("onError: %s", message) Toast.makeText( diff --git a/telnyx_rtc/build.gradle b/telnyx_rtc/build.gradle index 4f318068..4ca1c6e5 100644 --- a/telnyx_rtc/build.gradle +++ b/telnyx_rtc/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'maven-publish' apply plugin: "com.bugsnag.android.gradle" def getVersionName = { -> - return "1.3.3" + return "1.3.5" } def getArtifactId = { -> @@ -78,7 +78,7 @@ dokkaHtml.configure { android { - compileSdkVersion 33 + compileSdkVersion 34 buildToolsVersion "30.0.3" androidExtensions { @@ -87,7 +87,7 @@ android { defaultConfig { minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" @@ -198,7 +198,7 @@ dependencies { implementation deps.ktor.gson implementation deps.ktor.websockets implementation deps.ktor.okhttp - implementation 'androidx.lifecycle:lifecycle-process:2.5.1' + implementation 'androidx.lifecycle:lifecycle-process:2.7.0' testImplementation deps.ktor.client_test implementation 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.7.10' @@ -207,8 +207,6 @@ dependencies { //BugSnag: implementation "com.bugsnag:bugsnag-android:5.+" - // Volley - implementation deps.volley // Firebase implementation platform(deps.firebasebom) @@ -266,7 +264,7 @@ dependencies { androidTestImplementation 'androidx.test.ext:truth:1.4.0' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.work:work-testing:2.7.1' - androidTestImplementation "io.mockk:mockk-android:1.12.5" + androidTestImplementation "io.mockk:mockk-androitd:1.12.5" debugImplementation 'androidx.fragment:fragment-testing:1.5.2' debugImplementation 'androidx.test:core-ktx:1.4.0' @@ -276,7 +274,6 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - def lifecycle_version = "2.4.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" + def lifecycle_version = "2.7.0" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" } diff --git a/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/TelnyxClient.kt b/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/TelnyxClient.kt index 241cad4f..1424bb40 100644 --- a/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/TelnyxClient.kt +++ b/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/TelnyxClient.kt @@ -804,7 +804,6 @@ class TelnyxClient( SpeakerMode.EARPIECE -> { audioManager?.isSpeakerphoneOn = false } - SpeakerMode.UNASSIGNED -> audioManager?.isSpeakerphoneOn = false } } diff --git a/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/verto/receive/SocketObserver.kt b/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/verto/receive/SocketObserver.kt index 4a812686..e6d70642 100644 --- a/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/verto/receive/SocketObserver.kt +++ b/telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/verto/receive/SocketObserver.kt @@ -15,17 +15,13 @@ abstract class SocketObserver : Observer> { abstract fun onError(message: String?) abstract fun onSocketDisconnect() - override fun onChanged(t: SocketResponse?) { - if (t == null) { - onError("Socket Error") - } else { - when (t.status) { - SocketStatus.ESTABLISHED -> onConnectionEstablished() - SocketStatus.MESSAGERECEIVED -> onMessageReceived(t.data) - SocketStatus.LOADING -> onLoading() - SocketStatus.ERROR -> onError(t.errorMessage) - SocketStatus.DISCONNECT -> onSocketDisconnect() - } + override fun onChanged(value: SocketResponse) { + when (value.status) { + SocketStatus.ESTABLISHED -> onConnectionEstablished() + SocketStatus.MESSAGERECEIVED -> onMessageReceived(value.data) + SocketStatus.LOADING -> onLoading() + SocketStatus.ERROR -> onError(value.errorMessage) + SocketStatus.DISCONNECT -> onSocketDisconnect() } } } diff --git a/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/CallTest.kt b/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/CallTest.kt index 656b2325..cd77ef3c 100644 --- a/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/CallTest.kt +++ b/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/CallTest.kt @@ -287,11 +287,12 @@ fun LiveData.getOrAwaitValue( var data: T? = null val latch = CountDownLatch(1) val observer = object : Observer { - override fun onChanged(o: T?) { - data = o + override fun onChanged(value: T) { + data = value latch.countDown() this@getOrAwaitValue.removeObserver(this) } + } this.observeForever(observer) diff --git a/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/TelnyxClientTest.kt b/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/TelnyxClientTest.kt index b0e007ef..5ea2771c 100644 --- a/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/TelnyxClientTest.kt +++ b/telnyx_rtc/src/test/java/com/telnyx/webrtc/sdk/TelnyxClientTest.kt @@ -649,8 +649,8 @@ class TelnyxClientTest : BaseTest() { var data: T? = null val latch = CountDownLatch(1) val observer = object : Observer { - override fun onChanged(o: T?) { - data = o + override fun onChanged(value: T) { + data = value latch.countDown() this@getOrAwaitValue.removeObserver(this) } diff --git a/versions.gradle b/versions.gradle index 84c320d4..cef29e40 100644 --- a/versions.gradle +++ b/versions.gradle @@ -19,7 +19,6 @@ versions.ktor = "1.5.3" versions.timber = "4.5.1" versions.dexter = "6.2.2" versions.googleservices = "4.3.8" -versions.volley = "1.1.1" versions.firebasebom = "28.2.1" versions.hilt = "2.43.2" versions.bugsnag = "7.+" @@ -37,7 +36,6 @@ deps.androidx_fragment = "androidx.fragment:fragment-ktx:$versions.androidx_frag deps.appcompat = "androidx.appcompat:appcompat:$versions.androidx_appcompat" deps.material = "com.google.android.material:material:$versions.material" deps.constraint_layout = "androidx.constraintlayout:constraintlayout:$versions.androidx_constraint_layout" -deps.volley = "com.android.volley:volley:$versions.volley" deps.webrtc = "org.webrtc:google-webrtc:$versions.webrtc" deps.gson = "com.google.code.gson:gson:$versions.gson" deps.websocket = "org.java-websocket:Java-WebSocket:$versions.websocket"