android: clean up unused method (#731)

https://github.com/tailscale/tailscale-android/pull/728 replaced getInterfacesAsString with getInterfacesAsJson. This cleans up that unused method.

Updates tailscale/tailscale#16836

Signed-off-by: kari-ts <kari@tailscale.com>
main
kari-ts 14 hours ago committed by GitHub
parent b533c471ed
commit cfb8d371b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -304,38 +304,6 @@ class App : UninitializedApp(), libtailscale.AppContext, ViewModelStoreOwner {
return packageManager.hasSystemFeature("android.hardware.type.pc")
}
override fun getInterfacesAsString(): String {
val interfaces: ArrayList<NetworkInterface> =
java.util.Collections.list(NetworkInterface.getNetworkInterfaces())
val sb = StringBuilder()
for (nif in interfaces) {
try {
sb.append(
String.format(
Locale.ROOT,
"%s %d %d %b %b %b %b %b |",
nif.name,
nif.index,
nif.mtu,
nif.isUp,
nif.supportsMulticast(),
nif.isLoopback,
nif.isPointToPoint,
nif.supportsMulticast()))
for (ia in nif.interfaceAddresses) {
val parts = ia.toString().split("/", limit = 0)
if (parts.size > 1) {
sb.append(String.format(Locale.ROOT, "%s/%d ", parts[1], ia.networkPrefixLength))
}
}
} catch (e: Exception) {
continue
}
sb.append("\n")
}
return sb.toString()
}
@Serializable
data class AddrJson(
val ip: String,

@ -48,10 +48,6 @@ type AppContext interface {
// IsChromeOS reports whether we're on a ChromeOS device.
IsChromeOS() (bool, error)
// GetInterfacesAsString gets a string representation of all network
// interfaces.
GetInterfacesAsString() (string, error)
// GetInterfacesAsJson gets a JSON representation of all network
// interfaces.
GetInterfacesAsJson() (string, error)

Loading…
Cancel
Save