Fix some lint errors.

This commit is contained in:
Greyson Parrelli
2025-03-27 13:56:48 -04:00
parent 8a2e15b76b
commit 80bc2bdc89
4 changed files with 13 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import android.telephony.PhoneStateListener
import android.telephony.TelephonyManager
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.IntentCompat
import androidx.core.os.bundleOf
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Single
@@ -232,6 +233,7 @@ class ActiveCallManager(
private fun registerNetworkReceiver() {
if (networkReceiver == null) {
networkReceiver = NetworkReceiver()
@Suppress("DEPRECATION")
application.registerReceiver(networkReceiver, IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION))
}
}
@@ -315,6 +317,7 @@ class ActiveCallManager(
return type
}
@Suppress("DEPRECATION")
private var hangUpRtcOnDeviceCallAnswered: PhoneStateListener? = null
private var notificationDisposable: Disposable = Disposable.disposed()
@@ -333,6 +336,7 @@ class ActiveCallManager(
if (!AndroidTelecomUtil.telecomSupported) {
try {
@Suppress("DEPRECATION")
TelephonyUtil.getManager(application).listen(hangUpRtcOnDeviceCallAnswered, PhoneStateListener.LISTEN_CALL_STATE)
} catch (e: SecurityException) {
Log.w(TAG, "Failed to listen to PSTN call answers!", e)
@@ -348,6 +352,7 @@ class ActiveCallManager(
super.onDestroy()
if (!AndroidTelecomUtil.telecomSupported) {
@Suppress("DEPRECATION")
TelephonyUtil.getManager(application).listen(hangUpRtcOnDeviceCallAnswered, PhoneStateListener.LISTEN_NONE)
}
}
@@ -366,7 +371,7 @@ class ActiveCallManager(
}
val type = intent.getIntExtra(EXTRA_TYPE, 0)
val recipient: Recipient = Recipient.resolved(intent.getParcelableExtra(EXTRA_RECIPIENT_ID)!!)
val recipient: Recipient = Recipient.resolved(IntentCompat.getParcelableExtra(intent, EXTRA_RECIPIENT_ID, RecipientId::class.java)!!)
val isVideoCall = intent.getBooleanExtra(EXTRA_IS_VIDEO_CALL, false)
if (requiresAsyncNotificationLoad) {
@@ -402,6 +407,7 @@ class ActiveCallManager(
@Suppress("deprecation")
private class HangUpRtcOnPstnCallAnsweredListener : PhoneStateListener() {
@Deprecated("Deprecated in Java")
override fun onCallStateChanged(state: Int, phoneNumber: String) {
super.onCallStateChanged(state, phoneNumber)
if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
@@ -432,6 +438,7 @@ class ActiveCallManager(
}
}
@Suppress("DEPRECATION")
private class NetworkReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager