Files
tailscale/feature/androidbin/register.go
T
Loz Brown 678b3be66b feature/androidbin: register Android cgo fallback
Enable the existing Android-safe interface fallback in cgo
builds. Keep androidbin out of condregister for Android cgo
applications, which provide their own interface getter; embedded
consumers can opt in by importing androidbin directly.

Updates #17311

Change-Id: Ia26706d9757525c1bc619935574797808b693034
Signed-off-by: Loz Brown <9961593+lozbrown@users.noreply.github.com>
2026-11-22 15:06:36 -08:00

21 lines
472 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux || android
package androidbin
import (
"tailscale.com/feature"
"tailscale.com/net/netmon"
)
// Android apps may register a Java-backed interface getter. This fallback
// is consulted only if no getter is registered and net.Interfaces fails.
func init() {
if !feature.Register("androidbin") {
return
}
netmon.HookInterfacesFallback.Set(fallbackInterfaces)
}