Add createL2capNetwork helper

Adds a function to create a tun interface configured for blocking i/o.
Also adds a helper function to create an L2capNetwork which calls
createTunInterface(). createL2capNetwork() requires the caller to pass a
*connected* BluetoothSocket and will be used for both server and client
networks.

Note that this split isn't particularly logical (because this function
does not get called yet), but was the easiest way to make the code more
reviewable.

Test: atest L2capNetworkProviderTest
Change-Id: I61efbedbf56fe9b4ba6d0050eaa29ead3023da3f
1 file changed