Removed unnecessary wake lock updates

This commit is contained in:
Juha Heinanen
2026-04-14 08:33:01 +03:00
parent bbe81ab80b
commit 219779a101

View File

@ -352,6 +352,7 @@ class BaresipService: Service() {
} }
updateDnsServers() updateDnsServers()
updatePartialWakeLock()
val assets = arrayOf("accounts", "config", "contacts") val assets = arrayOf("accounts", "config", "contacts")
var file = File(filesPath) var file = File(filesPath)
@ -746,7 +747,6 @@ class BaresipService: Service() {
if (uas.value[accountIndex].account.aor == aor) { if (uas.value[accountIndex].account.aor == aor) {
when (ev[0]) { when (ev[0]) {
"registering", "unregistering" -> { "registering", "unregistering" -> {
updatePartialWakeLock()
ua.updateStatus(circleYellow.getValue(colorblind)) ua.updateStatus(circleYellow.getValue(colorblind))
updateStatusNotification() updateStatusNotification()
if (isMainVisible) if (isMainVisible)
@ -754,7 +754,6 @@ class BaresipService: Service() {
return return
} }
"registered" -> { "registered" -> {
updatePartialWakeLock()
ua.updateStatus( ua.updateStatus(
if (Api.account_regint(ua.account.accp) == 0) if (Api.account_regint(ua.account.accp) == 0)
R.drawable.circle_white R.drawable.circle_white
@ -767,7 +766,6 @@ class BaresipService: Service() {
return return
} }
"registering failed" -> { "registering failed" -> {
updatePartialWakeLock()
ua.updateStatus(if (Api.account_regint(ua.account.accp) == 0) ua.updateStatus(if (Api.account_regint(ua.account.accp) == 0)
R.drawable.circle_white R.drawable.circle_white
else else
@ -1635,8 +1633,6 @@ class BaresipService: Service() {
Log.e(TAG, "Failed to update foreground notification: ${e.message}") Log.e(TAG, "Failed to update foreground notification: ${e.message}")
nm.notify(STATUS_NOTIFICATION_ID, notification) nm.notify(STATUS_NOTIFICATION_ID, notification)
} }
updatePartialWakeLock()
} }
@SuppressLint("WakelockTimeout") @SuppressLint("WakelockTimeout")
@ -1949,7 +1945,6 @@ class BaresipService: Service() {
private fun updateNetwork() { private fun updateNetwork() {
if (!isNativeReady) return if (!isNativeReady) return
updatePartialWakeLock()
updateDnsServers() updateDnsServers()
val addresses = linkAddresses() val addresses = linkAddresses()