32 - How to overcome the Wi-Fi Direct 32 limit on credentials in Android?

ε祈祈猫儿з 提交于 2019-12-02 04:05:32

CREDENTIAL_MAX_NUM is a limit on the number of WifiP2pGroup objects that the the WififP2pGroupList will store. It is not a limit on the number of devices that can be a member a single Wi-Fi Direct group - this is theoretically bounded by the IP address range of the group. It is a bound on the number of persistent groups that can be stored in and utilised by the device.

WifiP2pGroupList is instantiated by the Wi-Fi P2P service and is populated by the wpa_supplicant, so changing the value of CREDENTIAL_MAX_NUM by reflection is not a solution, as the bound may be inherited from the supplicant and the P2P service resides in the system server process.

The list object can be acquired by reflection (to do this requires the use of a dynamic proxy class to implement the hidden method WifiP2pManager.PersistentGroupInfoListener and then passing this to the system service via IPC), but it's use is limited - for all groups it will not contain credentials, so caching for future use is not possible. Modification of the list will be restricted to whatever is provided by methods that are exposed by the WifiP2pManager.

So to summarise, modification of the CREDENTIAL_MAX_NUM is not possible and even if it was, an upper bound may exist in the wpa_supplicant.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!