MainActivity: remove redundant Notifier start/stop (#293)

We're starting Notifier in App so that states are available outside of MA lifecycle.

Updates tailscale/corp#18202

Signed-off-by: kari-ts <kari@tailscale.com>
pull/289/head
kari-ts 4 weeks ago committed by GitHub
parent b4c0a6931d
commit 5745854297
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -63,7 +63,6 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
class MainActivity : ComponentActivity() {
private var notifierScope: CoroutineScope? = null
private lateinit var requestVpnPermission: ActivityResultLauncher<Unit>
companion object {
@ -254,9 +253,6 @@ class MainActivity : ComponentActivity() {
override fun onStart() {
super.onStart()
val scope = CoroutineScope(Dispatchers.IO)
notifierScope = scope
Notifier.start(lifecycleScope)
// (jonathan) TODO: Requesting VPN permissions onStart is a bit aggressive. This should
// be done when the user initiall starts the VPN
@ -264,7 +260,6 @@ class MainActivity : ComponentActivity() {
}
override fun onStop() {
Notifier.stop()
super.onStop()
val restrictionsManager =
this.getSystemService(Context.RESTRICTIONS_SERVICE) as RestrictionsManager

Loading…
Cancel
Save