Bug 425381 - Cannot add trusted networks (empty list)
Summary: Cannot add trusted networks (empty list)
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: unspecified
Platform: Other Android 10.x
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-15 13:36 UTC by user456
Modified: 2021-10-11 18:56 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description user456 2020-08-15 13:36:33 UTC
On a Samsung Galaxy A21S with Android 10 and KDE Connect 1.14.2 from f-droid:

Connect to wifi, open the app, go to Settings - Trusted networks, untick the checkbox to allow all networks, refresh the list. The list is empty, so the network cannot be set as trusted.

Additional info:
- File exchange works fine (if all networks are allowed).
- F-Droid also seems unable to see the SSID: the app swap feature (Nearby tab) works fine, except that it shows "unknown SSID". It does display the SSID on other phone models (with older Android versions) connected to the same network.
- The Trusted network feature works fine on other phone models (with older Android versions and the same KDE Connect app version) connected to the same network.

This does not look like a connectivity issue, however I could not find a matching permission or tunable in the system settings.
Comment 1 user456 2020-08-15 13:37:08 UTC
(Also note that the New bug form's Version list has no entry for version 1.14.)
Comment 2 Nicolas Fella 2020-08-17 14:29:42 UTC
Do you have granted KDE Connect the permission to access Location? It is needed to have access to the network's SSID and thus the feature to work.
Comment 3 user456 2020-08-17 18:28:18 UTC
Yes, "Allow only while using the app" is checked. (There is no "Allow" radio button.) The list of denied permissions at the bottom is empty.
Comment 4 Nicolas Fella 2020-08-21 19:16:33 UTC
Looks like KDE Connect has trouble accessing your wifi's SSID for some other reasons then. Hard to tell exactly unfortunately
Comment 5 Shiro K. 2020-08-24 15:04:19 UTC
I have the same bug using v1.14.2 (Google Play and f-droid) and Android 10 (Pixel 3a). I've seen a few people with the same bug: 
https://old.reddit.com/r/kde/comments/goxx2k/kde_connect_cant_add_a_trusted_network/
https://forum.kde.org/viewtopic.php?f=18&t=166179

This bug is already fixed on master branch as I can only reproduce it using Play Store version. Given that the last release (v1.14.2) was 4 months ago the changes didn't trickle down yet.

This commit 1a247eac (https://invent.kde.org/network/kdeconnect-android/-/commit/1a247eacc9264c325715529e8749860c6dccfaba) "Fix trusted networks on Android 10" is most likely the fix. 

Android 10 changed the way privacy permissions work (https://developer.android.com/about/versions/10/privacy/changes). ACCESS_FINE_LOCATION permission is now needed to access WiFi information and v1.14.2 only requests ACCESS_COARSE_LOCATION.
Comment 6 Dennis Schridde 2020-09-12 08:20:40 UTC
Seeing a version with this fix released to F-Droid would be great.  I am suffering from the same issue after the recent upgrade of my Fairphone 3 to Android 10.
Comment 7 Nicolas Fella 2020-09-12 11:50:22 UTC
We're planning to do a release soon-ish, but there's no hard date for it
Comment 8 Richard Llom 2021-10-10 19:09:37 UTC
(In reply to shiro_code from comment #5)
> I have the same bug using v1.14.2 (Google Play and f-droid) and Android 10
> (Pixel 3a). I've seen a few people with the same bug: 
> https://old.reddit.com/r/kde/comments/goxx2k/
> kde_connect_cant_add_a_trusted_network/
> https://forum.kde.org/viewtopic.php?f=18&t=166179
> 
> This bug is already fixed on master branch as I can only reproduce it using
> Play Store version. Given that the last release (v1.14.2) was 4 months ago
> the changes didn't trickle down yet.
> 
> This commit 1a247eac
> (https://invent.kde.org/network/kdeconnect-android/-/commit/
> 1a247eacc9264c325715529e8749860c6dccfaba) "Fix trusted networks on Android
> 10" is most likely the fix. 
> 
> Android 10 changed the way privacy permissions work
> (https://developer.android.com/about/versions/10/privacy/changes).
> ACCESS_FINE_LOCATION permission is now needed to access WiFi information and
> v1.14.2 only requests ACCESS_COARSE_LOCATION.

Has this fix been merged and released?

I still have this issue under Android 11 and KDE Connect 1.17.0.

Not sure if this a new bug or still the same...
Comment 9 Shiro K. 2021-10-10 19:27:33 UTC
Yes it is fixed since v1.15.0, at least for me.

When connected to a untrusted network button, a orange button on the bottom "Add <SSID>" should appear. This is on the trusted networks menu. You need to be connected to the network you want to add for the button to appear. Running v1.17.0 and Android 11.

If it doesn't appear it is probably another bug.
Comment 10 Richard Llom 2021-10-10 21:39:04 UTC
I did some investigation:
When location is toggled off in the android settings, you cannot add a new ssid (they don't appear).

Toggling Location "on" makes the network appear.


And even when you have added your ssid/network to the list, but location is off (again), KDE connect still gives you the "Not on a trusted network..." message on the pair a new device page. (However connection with paired devices work just fine.)

So I think there is something wrong/missing with the implementation under Android 10.
And as per OP F-Droid seems to have the same issues.

Can you confirm Shiro?
Comment 11 Shiro K. 2021-10-10 22:46:38 UTC
I think that is intended and correct behaviour.

On Android 10+, Wifi information is directly tied to the location permission. If location is off on-device, KDE connect can't get the SSID. This is Android behaviour and it is due to the fact that a SSID (especially a unique one) can be traced to a location very easily. 

Unfortunately you need to keep location on if you use trusted networks, otherwise auto-discover does not work. You can circumvent this if you "Add devices by IP". Also current connected devices connections shouldn't be affected if you toggle location on/off. 


Also (this is unrelated to this bug) on Android 10+ for a app to get location when in background, a special permission is needed; ACCESS_BACKGROUND_LOCATION (shows as "Allow all the time" instead of only "Allow only while using the app"). KDE Connect currently doesn't ask for this permission. To get this permission onto the Play Store you need to be ask/review with Google with a good reason to get it (not sure if KDE Connect would be approved) (https://support.google.com/googleplay/android-developer/answer/9799150). So whenever you connect to a trusted network you need to open the app for autodiscover to kick in, because KDE Connect can't get the SSID when not open (in the background). You can build the app yourself with this permission to make KDE Connect connect to the PC even when your phone is locked. I should probably open a bug/pull request for this.
Comment 12 Shiro K. 2021-10-10 22:57:28 UTC
Also it would be great if KDE Connect warns the user that location is off on the trusted networks menu and on the home page if trusted networks is on. This would probably solve lots of confusion/bug reports in the future
Comment 13 Richard Llom 2021-10-11 18:56:16 UTC
(In reply to Shiro K. from comment #12)
> Also it would be great if KDE Connect warns the user that location is off on
> the trusted networks menu and on the home page if trusted networks is on.
> This would probably solve lots of confusion/bug reports in the future

ABSOLUTELY!!!

> I should probably open a bug/pull request for this.

Yes, please do so. I'm closing this one as fixed.