android: synchronize Notifier app initialization (#568)

@Synchronize Notifier.setApp and Notifier.start to make sure that app isn't being accessed while being set.

Updates tailscale/corp#24694

Signed-off-by: kari-ts <kari@tailscale.com>
pull/572/head
kari-ts 5 days ago committed by GitHub
parent d512aeffd1
commit 0fe76a7d46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -52,11 +52,13 @@ object Notifier {
private lateinit var app: libtailscale.Application
private var manager: libtailscale.NotificationManager? = null
@Synchronized
@JvmStatic
fun setApp(newApp: libtailscale.Application) {
app = newApp
}
@Synchronized
@OptIn(ExperimentalSerializationApi::class)
fun start(scope: CoroutineScope) {
TSLog.d(TAG, "Starting Notifier")

Loading…
Cancel
Save