Skip to content

Commit

Permalink
fix(ble): ble on android was disable with an hardcoded if condition...
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Jan 16, 2019
1 parent b6f744d commit 68b8029
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions client/react-native/gomobile/core/config.go
@@ -1,7 +1,5 @@
package core

import "runtime"

// This file contain the configuration by default

// Initial configs will be used to set default settings in state DB
Expand Down Expand Up @@ -33,9 +31,3 @@ const (

defaultLocalGRPCPort = 4242
)

func init() {
if runtime.GOOS == "android" {
initialNetConf.BluetoothTransport = false
}
}
3 changes: 1 addition & 2 deletions client/react-native/gomobile/core/network.go
Expand Up @@ -3,7 +3,6 @@ package core
import (
"encoding/json"
"io"
"runtime"
"strings"

account "berty.tech/core/manager/account"
Expand Down Expand Up @@ -44,7 +43,7 @@ func createNetworkConfig() (*account.P2PNetworkOptions, error) {
transport = append(transport, "quic")
bind = append(bind, quicBind)
}
if netConf.BluetoothTransport && runtime.GOOS != "android" {
if netConf.BluetoothTransport {
transport = append(transport, "ble")
bind = append(bind, defaultBLEBind)
}
Expand Down
2 changes: 1 addition & 1 deletion core/manager/account/p2p.go
Expand Up @@ -31,7 +31,7 @@ func makeTransport(opts *P2PNetworkOptions, p2pOptions []p2p.Option, db *gorm.DB
for _, v := range opts.Transport {
if v == "default" {
p2pOptions = append(p2pOptions, p2p.WithDefaultTransports())
} else if v == "ble" && runtime.GOOS != "android" {
} else if v == "ble" {
p2pOptions = append(p2pOptions, p2p.WithTransportBle(opts.Bind, db))
}
}
Expand Down

0 comments on commit 68b8029

Please sign in to comment.