bump target

This commit is contained in:
Zane Schepke 2024-11-03 01:48:46 -04:00
parent d3ea75869a
commit c01b045022
4 changed files with 12 additions and 4 deletions

View File

@ -166,6 +166,7 @@
<service
android:name=".service.foreground.TunnelBackgroundService"
android:exported="false"
android:persistent="true"
android:foregroundServiceType="systemExempted"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>

View File

@ -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() {

View File

@ -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"

View File

@ -1 +1 @@
10
0