-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom URL does not work if Wifi/Mobile data is not enabled, but bluetooth PAN is available #1197
Comments
I haven't encountered this kind of a setup before so it sounds very specific/niche to me. I don't think it's catered to in the Android WorkRequest setup. In the app the Custom URL has a network requirement, gpslogger/gpslogger/src/main/java/com/mendhak/gpslogger/common/Systems.java Lines 330 to 332 in 2d0e36c
That NetworkType for either condition is from this page: https://developer.android.com/reference/androidx/work/NetworkType The purpose behind the network check is so that the jobs don't get queued up without a working connection. And I'm assuming there must be (or hope there is) some kind of network connectivity test that happens before the system returns that connected = true. Your local fix looks quite good, I wonder if there's a simpler way which is to remove the constraints from the builder: gpslogger/gpslogger/src/main/java/com/mendhak/gpslogger/common/Systems.java Lines 334 to 337 in 2d0e36c
And that could simply mean "just send it, I don't care for network connectivity". |
I can try this tomorrow, without constraints. Thanks a lot. |
Same issue here. I run into this problem when I try logging to my local web server 192.168.. through WiFi and it works perfectly fine when the internet access for this subnet is enabled on a router, but if it is not, the logging to the local server stops working. Additionally, the same thing happens if I block internet access in Android using AFWall. The issue was not present in v.130 and below. |
Then for sure it must be related to WorkManager's network 'detection' logic. 131 is when Workmanager was introduced, since I had to move away from the old library. |
Environement:
Phone that has disabled mobile data and wifi, but has a bluetooth tetering enabled with another device that runs a flask server.
Bug description:
The GET request is never executed or it fails out (I haven't investigated much)
My local fix:
Open socket and let Android handle the connection:
BluetoothDirectClient class that has the sendRequest function
Then, I called it in GpsLoggerService at onLocationChanged, as i couldn't reach the doWork function inside the CustomUrlWorker
Mind you, I am in no way an Android expert, and I have not tested much my solution, just wanted to expose a limitation :)
The text was updated successfully, but these errors were encountered: