From 288b46647c9c256d8cdeee95fd534aa57efd4b00 Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Wed, 8 Apr 2026 18:49:35 +0700 Subject: [PATCH] fix: more fixes to google sheeeat --- android/src/main/AndroidManifest.xml | 2 +- .../kotlin/xyz/nuark/liblinphone_flutter/LinphoneBridge.kt | 2 ++ .../xyz/nuark/liblinphone_flutter/LinphoneVoipService.kt | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 32ab76e..dbf6480 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -26,7 +26,7 @@ android:name=".LinphoneVoipService" android:enabled="true" android:exported="false" - android:foregroundServiceType="phoneCall" + android:foregroundServiceType="phoneCall|microphone" android:stopWithTask="false" /> diff --git a/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneBridge.kt b/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneBridge.kt index 85b40f7..4f6bf12 100644 --- a/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneBridge.kt +++ b/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneBridge.kt @@ -205,6 +205,8 @@ class LinphoneBridge( core.config.setInt("net", "ipv6", 0) core.config.sync() + core.setKeepAlivePeriod(25) + // Enable video core.isVideoCaptureEnabled = true core.isVideoDisplayEnabled = true diff --git a/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneVoipService.kt b/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneVoipService.kt index 64530e8..edc29e5 100644 --- a/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneVoipService.kt +++ b/android/src/main/kotlin/xyz/nuark/liblinphone_flutter/LinphoneVoipService.kt @@ -29,7 +29,7 @@ class LinphoneVoipService : Service() { // Android 14+ requires explicit service type in startForeground if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { - startForeground(100, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL) + startForeground(100, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE) } else { startForeground(100, notification) } @@ -65,7 +65,7 @@ class LinphoneVoipService : Service() { return NotificationCompat.Builder(this, channelId) .setContentTitle("Voice Call") .setContentText("Call in progress") - .setSmallIcon(android.R.drawable.ic_menu_call) // Replace with your app's call icon + .setSmallIcon(android.R.drawable.ic_menu_call) .setOngoing(true) .setCategory(NotificationCompat.CATEGORY_CALL) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)