Avoid some analyser warnings

This commit is contained in:
Juha Heinanen
2025-07-11 10:18:07 +03:00
parent 98a56353d6
commit e6072eb0db
2 changed files with 11 additions and 14 deletions

View File

@ -712,9 +712,9 @@ class BaresipService: Service() {
if (aecAvailable) {
aec = AcousticEchoCanceler.create(recorderSessionId)
if (aec != null) {
if (!aec!!.getEnabled()) {
aec!!.setEnabled(true)
if (aec!!.getEnabled())
if (!aec!!.enabled) {
aec!!.enabled = true
if (aec!!.enabled)
Log.d(TAG, "AEC is enabled")
else
Log.w(TAG, "Failed to enable AEC")
@ -727,9 +727,9 @@ class BaresipService: Service() {
if (agcAvailable) {
agc = AutomaticGainControl.create(recorderSessionId)
if (agc != null) {
if (!agc!!.getEnabled()) {
agc!!.setEnabled(true)
if (agc!!.getEnabled())
if (!agc!!.enabled) {
agc!!.enabled = true
if (agc!!.enabled)
Log.d(TAG, "AGC is enabled")
}
} else
@ -738,9 +738,9 @@ class BaresipService: Service() {
if (nsAvailable) {
ns = NoiseSuppressor.create(recorderSessionId)
if (ns != null) {
if (!ns!!.getEnabled()) {
ns!!.setEnabled(true)
if (ns!!.getEnabled())
if (!ns!!.enabled) {
ns!!.enabled = true
if (ns!!.enabled)
Log.d(TAG, "NS is enabled")
}
} else

View File

@ -20,7 +20,6 @@ import android.widget.Chronometer
import android.widget.Toast
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.BorderStroke
@ -240,7 +239,6 @@ private fun MainScreen(
}
}
@RequiresApi(29)
fun launchBackupRequest() {
if (Build.VERSION.SDK_INT < 29) {
if (!Utils.checkPermissions(ctx, arrayOf(WRITE_EXTERNAL_STORAGE))) {
@ -284,7 +282,6 @@ private fun MainScreen(
}
}
@RequiresApi(29)
fun launchRestoreRequest() {
if (Build.VERSION.SDK_INT < 29) {
if (!Utils.checkPermissions(ctx, arrayOf(READ_EXTERNAL_STORAGE))) {
@ -1308,7 +1305,7 @@ private fun CallRow(ctx: Context, viewModel: ViewModel) {
onClick = {
showSuggestions.value = false
abandonAudioFocus(ctx)
var ua: UserAgent = UserAgent.ofAor(viewModel.selectedAor.value)!!
val ua: UserAgent = UserAgent.ofAor(viewModel.selectedAor.value)!!
val call = ua.currentCall()
if (call != null) {
val callp = call.callp
@ -2418,7 +2415,7 @@ fun callAction(ctx: Context, viewModel: ViewModel, uri: Uri?, action: String) {
Log.d(TAG, "Action $action to $uri")
if (uri != null) {
var uriStr: String
var uap = 0L
var uap: Long
when (uri.scheme) {
"sip" -> {
uriStr = Utils.uriUnescape(uri.toString())