platform: Implement set underlying networks for android

This commit is contained in:
世界
2024-12-22 01:00:19 +08:00
parent f0f3a45904
commit eb4a184b7e
8 changed files with 43 additions and 0 deletions

View File

@@ -206,11 +206,18 @@ func (w *platformInterfaceWrapper) Interfaces() ([]adapter.NetworkInterface, err
DNSServers: iteratorToArray[string](netInterface.DNSServer),
Expensive: netInterface.Metered || isDefault && w.isExpensive,
Constrained: isDefault && w.isConstrained,
RawNetwork: netInterface.RawNetwork,
})
}
return interfaces, nil
}
func (w *platformInterfaceWrapper) SetUnderlyingNetworks(networks []adapter.NetworkInterface) error {
return w.iif.SetUnderlyingNetworks(newIterator(common.Map(networks, func(it adapter.NetworkInterface) RawNetwork {
return it.RawNetwork.(RawNetwork)
})))
}
func (w *platformInterfaceWrapper) UnderNetworkExtension() bool {
return w.iif.UnderNetworkExtension()
}