Search code examples
androidandroid-wifiwifimanagerandroid-9.0-pie

Android 9 RTT Range Request status 1


I'm trying to use new Wifi RTT API to make range requests between two compatible devices (Pixel 3 smartphones).

Using Wifi-Aware, I publish a new service on the first device. With the second one, I subscribe to this service, and I use the peerHandle created to make range requests.

It worked well on my first try (for a range request every 1 second, I had one request over 3 with a success status (0))

But recently, all my range requests have a fail status (1) when I get the result of the request.

Did anyone have the same problem ?

I have the right permissions and the wifi is well activated.


Solution

  • Ok, we found the solution!

    In fact, when you shutdown the app on your first device without close() the session, your published service is still running on your hardware. You won't be able to use range request anymore even if you start a new session. The only way we found to really cut the session is to reboot the phone.

    So don't forget to close() all your services otherwise you will be blocked.