android/ui: remove Notifier initialization on ShareIntent (#422)

fixes tailscale/corp#12431

The share extension was initializing it's own Notifier.  It
does not need to, it simply needs to ensure the shared
app instance has been initialized and a suitable notifier
instance will already be running.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
jonathan/npe_crash_1
Jonathan Nobels 6 months ago committed by GitHub
parent 5b121c1876
commit 23805e9d00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,9 +14,7 @@ import androidx.activity.compose.setContent
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.lifecycle.lifecycleScope
import com.tailscale.ipn.ui.model.Ipn import com.tailscale.ipn.ui.model.Ipn
import com.tailscale.ipn.ui.notifier.Notifier
import com.tailscale.ipn.ui.theme.AppTheme import com.tailscale.ipn.ui.theme.AppTheme
import com.tailscale.ipn.ui.util.set import com.tailscale.ipn.ui.util.set
import com.tailscale.ipn.ui.util.universalFit import com.tailscale.ipn.ui.util.universalFit
@ -45,15 +43,11 @@ class ShareActivity : ComponentActivity() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
Notifier.start(lifecycleScope) // Ensure our app instance is initialized
App.get()
loadFiles() loadFiles()
} }
override fun onStop() {
super.onStop()
Notifier.stop()
}
override fun onNewIntent(intent: Intent?) { override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent) super.onNewIntent(intent)
setIntent(intent) setIntent(intent)

Loading…
Cancel
Save