WiFi P2P network in Android Things

I would like to create a P2P WiFi network using Android Things (5.1) and a couple of Raspberry Pi 3 or alternatively using Bluetooth. I followed the guide in the Android Developer section https://developer.android.com/guide/topics/connectivity/wifip2p.html, so my MainActivity looks like:

private class MainActtivity { private WifiP2pManager mManager; .... @Override public void onCreate(Bundle savedInstances) { mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); .... } }

However when I try to run the app, with WiFI enabled, the SystemServiceRegistry shows a message stating

No service published for: wifip2p
and the WifiP2pManager is not retrieved.

How can I solve this issue? Does anybody know if it is possible to create a WiFi P2P network using WiFi Direct and Android Things?