From b282212ae239a09caeccd7aeef4f9a231f6cef4b Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sat, 15 Apr 2023 13:51:13 +0300 Subject: [PATCH] Initialize activeNetwork at start --- app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index b97eaae7..70229506 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -425,9 +425,11 @@ class BaresipService: Service() { var addresses = "" for (la in linkAddresses) addresses = "$addresses;${la.key};${la.value}" - Log.i(TAG, "Link addresses: $addresses") + activeNetwork = cm.activeNetwork + Log.i(TAG, "Active network: $activeNetwork") + Thread { baresipStart(filesPath, addresses.removePrefix(";"), logLevel) }.start() @@ -1342,7 +1344,7 @@ class BaresipService: Service() { } val active = cm.activeNetwork - Log.d(TAG, "Added/Removed/Active = $added/$removed/$active") + Log.d(TAG, "Added/Removed/Old/New Active = $added/$removed/$activeNetwork/$active") if (added > 0 || removed > 0 || active != activeNetwork) { linkAddresses = addresses