The problem is that not all Android devices have such a custom name, so there is no direct way to get it reliable.
What I experienced (at least for Samsung) is that the user-defined username is also used for the WifiP2pDevice name: http://developer.android.com/reference/android/net/wifi/p2p/ WifiP2pDevice.html
Some manufacturers also use it as the default Bluetooth name or as the host name, in any case, you can check which property is used for your phone using dumpsys in the adb shell
dumpsys | grep 'My new phone'
source share