Skip to content

Commit cfb8d37

Browse files
authored
android: clean up unused method (#731)
#728 replaced getInterfacesAsString with getInterfacesAsJson. This cleans up that unused method. Updates tailscale/tailscale#16836 Signed-off-by: kari-ts <[email protected]>
1 parent b533c47 commit cfb8d37

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

android/src/main/java/com/tailscale/ipn/App.kt

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -304,38 +304,6 @@ class App : UninitializedApp(), libtailscale.AppContext, ViewModelStoreOwner {
304304
return packageManager.hasSystemFeature("android.hardware.type.pc")
305305
}
306306

307-
override fun getInterfacesAsString(): String {
308-
val interfaces: ArrayList<NetworkInterface> =
309-
java.util.Collections.list(NetworkInterface.getNetworkInterfaces())
310-
val sb = StringBuilder()
311-
for (nif in interfaces) {
312-
try {
313-
sb.append(
314-
String.format(
315-
Locale.ROOT,
316-
"%s %d %d %b %b %b %b %b |",
317-
nif.name,
318-
nif.index,
319-
nif.mtu,
320-
nif.isUp,
321-
nif.supportsMulticast(),
322-
nif.isLoopback,
323-
nif.isPointToPoint,
324-
nif.supportsMulticast()))
325-
for (ia in nif.interfaceAddresses) {
326-
val parts = ia.toString().split("/", limit = 0)
327-
if (parts.size > 1) {
328-
sb.append(String.format(Locale.ROOT, "%s/%d ", parts[1], ia.networkPrefixLength))
329-
}
330-
}
331-
} catch (e: Exception) {
332-
continue
333-
}
334-
sb.append("\n")
335-
}
336-
return sb.toString()
337-
}
338-
339307
@Serializable
340308
data class AddrJson(
341309
val ip: String,

libtailscale/interfaces.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ type AppContext interface {
4848
// IsChromeOS reports whether we're on a ChromeOS device.
4949
IsChromeOS() (bool, error)
5050

51-
// GetInterfacesAsString gets a string representation of all network
52-
// interfaces.
53-
GetInterfacesAsString() (string, error)
54-
5551
// GetInterfacesAsJson gets a JSON representation of all network
5652
// interfaces.
5753
GetInterfacesAsJson() (string, error)

0 commit comments

Comments
 (0)