Skip to content

Commit

Permalink
android: synchronize Notifier app initialization (#568)
Browse files Browse the repository at this point in the history
@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 <[email protected]>
  • Loading branch information
kari-ts authored Nov 22, 2024
1 parent d512aef commit 0fe76a7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0fe76a7

Please sign in to comment.