diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7c81484..15a9623 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -166,6 +166,7 @@ diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/TunnelBackgroundService.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/TunnelBackgroundService.kt index 66ae9c9..620631b 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/TunnelBackgroundService.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/TunnelBackgroundService.kt @@ -3,9 +3,11 @@ package com.zaneschepke.wireguardautotunnel.service.foreground import android.app.Notification import android.content.Intent import android.os.IBinder +import androidx.core.app.ServiceCompat import androidx.lifecycle.LifecycleService import com.zaneschepke.wireguardautotunnel.R import com.zaneschepke.wireguardautotunnel.service.notification.NotificationService +import com.zaneschepke.wireguardautotunnel.util.Constants import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CompletableDeferred import javax.inject.Inject @@ -23,7 +25,7 @@ class TunnelBackgroundService : LifecycleService() { override fun onCreate() { super.onCreate() - startForeground(foregroundId, createNotification()) + start() } override fun onBind(intent: Intent): IBinder? { @@ -38,7 +40,12 @@ class TunnelBackgroundService : LifecycleService() { } fun start() { - startForeground(foregroundId, createNotification()) + ServiceCompat.startForeground( + this, + foregroundId, + createNotification(), + Constants.SYSTEM_EXEMPT_SERVICE_TYPE_ID, + ) } fun stop() { diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index 2b35948..c7b02f7 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -2,7 +2,7 @@ object Constants { const val VERSION_NAME = "3.6.0" const val JVM_TARGET = "17" const val VERSION_CODE = 36000 - const val TARGET_SDK = 34 + const val TARGET_SDK = 35 const val MIN_SDK = 26 const val APP_ID = "com.zaneschepke.wireguardautotunnel" const val APP_NAME = "wgtunnel" diff --git a/versionCode.txt b/versionCode.txt index 9a03714..c227083 100644 --- a/versionCode.txt +++ b/versionCode.txt @@ -1 +1 @@ -10 \ No newline at end of file +0 \ No newline at end of file