I am writing an app which I want to connect to a closed (no internet access) bluetooth PAN to access a local data server. When connecting to the PAN I want the user to still have internet access via their existing 4G/WiFi data connection.
I have set up DNSMasq on the PAN gateway and have configured the dns options to not provide a gateway/DNS server for the interface.
Using reflection I can connect a phone to the PAN but the phone then drops any other network connections.
With the new Android api's (NetworkBuilder & ConnectivityManager.requestNetwork) I can request a WiFi connection before connecting to the PAN and the phone will keep both connections up. The problem is that other apps on the phone still do not have internet access. It would appear that the device is adding a default route for the bt-pan interface, even though dhcp has not provided a router option (confirmed via Wireshark).
Is it possible to connect to a network without setting a default gateway so other apps will continue to use 4G/WiFi interface?