It uses hidden method. You can change the device name using the following code
Method m = manager.getClass().getMethod("setDeviceName", new Class[] {channel.getClass(), String.class,
WifiP2pManager.ActionListener.class});
m.invoke(manager, channel, newDeviceName, new WifiP2pManager.ActionListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(int reason) {
}
});