diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index d10bc218..eff53f0c 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -73,13 +73,16 @@ + android:directBootAware="true" + android:foregroundServiceType="location|connectedDevice"/> + android:directBootAware="true" + android:foregroundServiceType="location|connectedDevice"/> + android:directBootAware="true" + android:foregroundServiceType="connectedDevice"/> = 26 && app.uiMode.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION) { + if (Build.VERSION.SDK_INT >= 26 && app.uiMode.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION || + // or bump self to foreground location service to use foreground location permission + Build.VERSION.SDK_INT >= 29 && intent?.getBooleanExtra(EXTRA_POSSIBLY_BACKGROUND, false) == true) { showNotification() } launch { diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterTileService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterTileService.kt index 27b312ec..da6d2474 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterTileService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterTileService.kt @@ -35,8 +35,8 @@ class RepeaterTileService : KillableTileService() { val binder = binder if (binder == null) tapPending = true else when (binder.service.status) { RepeaterService.Status.ACTIVE -> binder.shutdown() - RepeaterService.Status.IDLE -> - ContextCompat.startForegroundService(this, Intent(this, RepeaterService::class.java)) + RepeaterService.Status.IDLE -> ContextCompat.startForegroundService(this, + Intent(this, RepeaterService::class.java).putExtra(RepeaterService.EXTRA_POSSIBLY_BACKGROUND, true)) else -> { } } }