Skip to content

Commit

Permalink
MainActivity: remove redundant Notifier start/stop (#293)
Browse files Browse the repository at this point in the history
We're starting Notifier in App so that states are available outside of MA lifecycle.

Updates tailscale/corp#18202

Signed-off-by: kari-ts <[email protected]>
  • Loading branch information
kari-ts committed Apr 25, 2024
1 parent b3b299e commit b0fd028
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions android/src/main/java/com/tailscale/ipn/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -254,17 +253,13 @@ 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
requestVpnPermission()
}

override fun onStop() {
Notifier.stop()
super.onStop()
val restrictionsManager =
this.getSystemService(Context.RESTRICTIONS_SERVICE) as RestrictionsManager
Expand Down

0 comments on commit b0fd028

Please sign in to comment.