Moved Android GOOS const to common
This commit is contained in:
parent
1a7414312e
commit
3e53eabe4b
|
@ -0,0 +1,5 @@
|
|||
package common
|
||||
|
||||
const (
|
||||
AndroidPlatform = "android"
|
||||
)
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/status-im/status-go/common"
|
||||
"github.com/status-im/status-go/logutils"
|
||||
)
|
||||
|
||||
|
@ -14,10 +15,6 @@ var (
|
|||
Localhost = "Localhost"
|
||||
)
|
||||
|
||||
const (
|
||||
AndroidPlatform = "android"
|
||||
)
|
||||
|
||||
func GetOutboundIP() (net.IP, error) {
|
||||
conn, err := net.Dial("udp", "255.255.255.255:8080")
|
||||
if err != nil {
|
||||
|
@ -92,7 +89,7 @@ func getAndroidLocalIP() ([][]net.IP, error) {
|
|||
func getLocalAddresses() ([][]net.IP, error) {
|
||||
// TODO until we can resolve Android errors when calling net.Interfaces() just return the outbound local address.
|
||||
// Sorry Android
|
||||
if runtime.GOOS == AndroidPlatform {
|
||||
if runtime.GOOS == common.AndroidPlatform {
|
||||
return getAndroidLocalIP()
|
||||
}
|
||||
|
||||
|
@ -186,7 +183,7 @@ func getAllAvailableNetworks() ([]net.IPNet, error) {
|
|||
// that returns a reachable server's address to be used by local pairing client.
|
||||
func FindReachableAddressesForPairingClient(serverIps []net.IP) ([]net.IP, error) {
|
||||
// TODO until we can resolve Android errors when calling net.Interfaces() just noop. Sorry Android
|
||||
if runtime.GOOS == AndroidPlatform {
|
||||
if runtime.GOOS == common.AndroidPlatform {
|
||||
return serverIps, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/status-im/status-go/common"
|
||||
"github.com/status-im/status-go/logutils"
|
||||
"github.com/status-im/status-go/server"
|
||||
"github.com/status-im/status-go/server/pairing/peers"
|
||||
|
@ -44,7 +45,7 @@ func (p *PeerNotifier) handler(hello *peers.LocalPairingPeerHello) {
|
|||
|
||||
func (p *PeerNotifier) Search() error {
|
||||
// TODO until we can resolve Android errors when calling net.Interfaces() just noop. Sorry Android
|
||||
if runtime.GOOS == server.AndroidPlatform {
|
||||
if runtime.GOOS == common.AndroidPlatform {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue