I'm developing a module in Xposed Framework which tries to access to Wifi p2p service to modify it. This is perfectly working on an Samsung Galaxy S3 by the code found here: https://stackoverflow.com/a/18629705/2933485
It uses the class name "android.net.wifi.p2p.WifiP2pService" to access the method. My problem comes when trying to run it on a Moto E device, the logs say:
E/Xposed: java.lang.ClassNotFoundException: android.net.wifi.p2p.WifiP2pService
So I guess there must have been a change in the name of the class. ¿Does anyone have a reference on what could be going on with wifi p2p service on MOTO E (2nd generetion)? The version is lollipop 5.0.2
Lollipop onwards WifiP2pService class was not be avaiable! So, alternatively you can use WifiP2pManager class instead of WifiP2pService class and you can't get P2pStateMachine object from WifiP2pManager class because, P2pStateMachine was not available in WifiP2pManager class!
I have found one class in github for accept p2p connection automatically using WifiP2pManager on this link
Try above class and i'm not sure it will work perfectly or not :(