-
Notifications
You must be signed in to change notification settings - Fork 414
App cannot detect current network when in background due to missing ACCESS_BACKGROUND_LOCATION permission #1960
Comments
Is location enabled in the Android settings? If not, then you need to enable it, as otherwise Wi-Fi connectivity detection in the Syncthing app won't work.
This is unrelated to the issue at hand, but local discovery is broken in newer versions of Android, so if you disable global discovery (and relays), you will effectively have no discovery at all. |
the dependency of ssid and location service is android bullshit, that's clear. i'll edit the issue, to clarify that point. |
It does not. That's why I said it was an unrelated comment 🙃. The only thing that should have an impact here is whether you've got location services enabled in the Android settings and whether the app is allowed to access location. If both of those are true but the problem still persists, then it may also be something related to CalyxOS which is supposed to harden privacy, security, etc. which could possibly result in apps being unable to determine whether Wi-Fi is connected or not. This is just a speculation on my part though. |
it has all necessary rights and location service works properly. if you think i've done something wrong, or messed my config up, you're free to close this issue. I will not continue to test it. |
I can confirm the issue - still - with Syncthing Version 1.2 A configured, right SSID, will not be detected after "coming home"... |
Allow access to location all the time I think, worked for me |
I think we need to request the ACCESS_BACKGROUND_LOCATION permission. We declare it in the manifest but don't request it in the startup wizard. https://developer.android.com/training/location/permissions#request-background-location |
@bt90 Here's the two function that are needed to request it: |
I can also confirm the problem about automatically recognise the allowed ssid.
Using a "realme 7 (5G)" with Android 12. |
I was about to create an bug about this, and found this issue. The app can detect that Syncthing battery settings are not set to Unrestricted, and notifies the user to change it. The check should be performed only when the location services are really needed, i.e. when conditional run ("Run on wifi") is checked. It took me several hours to figure out the problem. This simple check would have helped to solve the problem immediately. |
I take it from this page that the following obtains.
Yes? Re 1: I lack the knowledge to make the pull-request myself, but I look forward to someone doing so. To this problem (/these problems), cf. (at least):
I reiterate the point (made by me, and another, on #1304) that living with the current situation - at least until one discovers the workaround (a workaround that I am about to test) - hammers one's phone's battery. Finally: ah, the workaround does not seem to work for me, in that Syncthing, when set to run on any wifi network, fails to detect when I am connected to my home network (or rather - I use dual-band wifi - to both of my wifi networks). |
This one is due to GitHub's confusing wording, i.e. when closing an issue as duplicate, you are supposed to use the right button, which then results in the "not planned" thing. I also do think that most if not all of these issues are likely related though. |
@tomasz1986 : you mean the rightmost button (i.e. the button on the right, as against a button that is by some criterion correct), I think! |
There are basically two options - close as completed (i.e. implemented) or close as not planned (which includes "won't fix", "can't repro", "duplicate", "stale", etc.). The problem is that this is only shown when actually closing the issue. Once closed using the latter, everyone sees it as "closed as not planned" regardless of the real reason for closing it. |
@tomasz1986 : right; thanks. I find: (1) granting full location permissions does not fix the problem whereby Syncthing fails to detect a wifi network (at least when using dual-band wifi); (2) even when one tells Syncthing to ignore 'run conditions', it will fail to start until it (Syncthing) is restarted. |
Syncthing app is configuered to start only on connection of a specific wifi ssid:
config options are: "Bei WLAN-Verbindung ausführen" AND "In festgelegtem WLAN-Netzwerk ausführen" (sorry, app is in german)
that means: use only wifi connectivity, don't use metered wifi, use only a specified ssid (which is displayed correctly)
other options: respect energy saving mode
[edit]
the real issue here
detecting the type and properties of connectivity (wifi, ssid of wifi, mobile data, metered, unmetered) depends on the global device discovery. this should be an independent task.
what I've observed
what I've expected
nice to have
the app has all rights, the battery management is "unlimited" and the "stop app when idle" is disabled
the app is configured to only do local discoveries
Version Information
The text was updated successfully, but these errors were encountered: