diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/App.kt b/mobile/src/main/java/be/mygod/vpnhotspot/App.kt index db59715b..5685ce33 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/App.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/App.kt @@ -1,5 +1,6 @@ package be.mygod.vpnhotspot +import android.annotation.TargetApi import android.app.Application import android.app.NotificationChannel import android.app.NotificationManager @@ -15,9 +16,12 @@ class App : Application() { override fun onCreate() { super.onCreate() app = this - if (Build.VERSION.SDK_INT >= 26) getSystemService(NotificationManager::class.java) - .createNotificationChannel(NotificationChannel(RepeaterService.CHANNEL, - "Hotspot Service", NotificationManager.IMPORTANCE_LOW)) + if (Build.VERSION.SDK_INT >= 26) @TargetApi(26) { + val nm = getSystemService(NotificationManager::class.java) + nm.createNotificationChannel(NotificationChannel(RepeaterService.CHANNEL, + "Repeater Service", NotificationManager.IMPORTANCE_LOW)) + nm.deleteNotificationChannel("hotspot") // remove old service channel + } } val pref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(this) } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index 20b0dfee..7ed38653 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -22,7 +22,7 @@ import java.util.regex.Pattern class RepeaterService : Service(), WifiP2pManager.ChannelListener, VpnListener.Callback { companion object { - const val CHANNEL = "hotspot" + const val CHANNEL = "repeater" const val STATUS_CHANGED = "be.mygod.vpnhotspot.RepeaterService.STATUS_CHANGED" private const val TAG = "RepeaterService"