Open sabzo opened 6 years ago
It turns out on Android 8+ at least as it relates to the Pixel 2, Location has to be turned on in order to discover nearby devices through Wifi Direct! cc @n8fr8
Issue somewhat similar to https://stackoverflow.com/questions/32151603/scan-results-available-action-return-empty-list-in-android-6-0
I have the same problem in my project on Android 8. If the solution is OK, please let me know. Thank you.
On Android 8+ you should get permission of ACCESS_COARSE_LOCATION, or can not get device list.
yep i found request the permission PLUS enable GPS will work.
@wxson7282 @amos-yau yea -- the Android docs don't clearly cover that part. I'm resuming development soon and I'd like to add Unit Tests.
On my OnePlus 3 (8.0.0) peer discovery only returned a result list when ACCESS_COURSE_LOCATION was granted and GPS was turned on. The wifi direct manager in the OxygenOS settings however showed an advertising peer without GPS turned on.
@chr33z is this for Ayanda or on another project?
On Pixel 2:
WifiDirect
class:WifiP2pManager.PeerListListener
'sonPeersAvailable
method fires but shows the list of devices as empty. It detects nearby devices but won't list them.