Skip to content
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

Cannot select Wi-Fi networks to whitelist on Android 10 #514

Closed
LordSushiPhoenix opened this issue Oct 17, 2019 · 16 comments · Fixed by #515
Closed

Cannot select Wi-Fi networks to whitelist on Android 10 #514

LordSushiPhoenix opened this issue Oct 17, 2019 · 16 comments · Fixed by #515
Assignees
Labels
android-restriction Caused by a recently introduced android restriction bug
Milestone

Comments

@LordSushiPhoenix
Copy link

Description of the issue

Opening the "Select Wi-Fi networks" menu to whitelist networks shows no networks.
Screenshot
Screenshot_20191016-200544
Screenshot_20191016-200604

Reproducer

Enabling "Run on specified Wi-Fi networks" leads the status tab to state "Android locations services are currently turned off. According to android restrictions, Syncthing cannot determine the current WiFi network name to decide if it should run" despite location being enabled.

Syncthing-fork has permission to use location while using the app (with no option to allow location access all the time).

Version Information

App Version: 1.3.0.1
Syncthing Version: v1.3.0
Android Version: Android 10
Device manufacturer: Essential
Device model: PH-1

Android Log

@Catfriend1
Copy link
Owner

Catfriend1 commented Oct 17, 2019

Hi,

I'll see if I can reproduce that on the 10 emulator. Otherwise I need to wait until my physical device gets 10.

Will keep it open.

Thanks for telling about the issue.

Note: https://medium.com/google-developer-experts/exploring-android-q-location-permissions-64d312b0e2e1

@Catfriend1 Catfriend1 added bug android-restriction Caused by a recently introduced android restriction labels Oct 17, 2019
@LordSushiPhoenix
Copy link
Author

Looking at this page Google changed the permissions required for wifi scanning with android 10.

@Catfriend1
Copy link
Owner

Catfriend1 commented Oct 17, 2019

  1. Requesting the background_location permission - already solved, see PR
2019-10-17 17:24:54.666 2244-2244/com.github.catfriend1.syncthingandroid.debug V/WifiSsidPreference: WifiSsidPreference class constructor
2019-10-17 17:24:58.521 2244-2244/com.github.catfriend1.syncthingandroid.debug V/WifiSsidPreference: showDialog
2019-10-17 17:24:58.522 2244-2244/com.github.catfriend1.syncthingandroid.debug V/WifiSsidPreference: configuredNetworks != null

@Catfriend1
Copy link
Owner

@LordSushiPhoenix Ok - but what makes me clueless at that point is that we don't do wifi scanning. We only ask Android which wifi SSID are already known because the user connected to them before.

@Catfriend1
Copy link
Owner

@Catfriend1
Copy link
Owner

Catfriend1 commented Oct 17, 2019

@LordSushiPhoenix
Copy link
Author

Sounds like Google...

Would it be possible to add the option to type SSIDs that you'd like to whitelist? Similar to how setting the SSID for a wifi connected state works in Tasker if you've used that. You can either type the SSID or click a button which returns a list of currently available networks.

@Catfriend1
Copy link
Owner

@Catfriend1
Copy link
Owner

@LordSushiPhoenix Basically possible, I need to learn how the UI is done for that (I'm not good at UI development :)

@LordSushiPhoenix
Copy link
Author

There would probably be some back end to deal with specifying by text too, depending on how syncthing currently compares networks at least. Might be easiest to just provide the list of networks from a scan instead of from configuration on android 10 for now.

@Catfriend1
Copy link
Owner

From scan would clutter the prefs in three ui places a lot with every network found in the past scans... I'd prefer learning mode, so you connect WiFi, the app learns the current ssid and stores it and then offers it to you on UI. Less pollution as long you don't delete a lot of wifi configurations from your phone afterwards. The user confusing part in scanning is one could tick a wifi by error without having access to it and then wonder why it doesnt sync.

@Catfriend1 Catfriend1 self-assigned this Oct 20, 2019
@Catfriend1 Catfriend1 modified the milestones: 1.3.1, 1.3.0 Oct 20, 2019
Catfriend1 pushed a commit that referenced this issue Oct 20, 2019
…) (#515)

* Update AndroidManifest.xml

* FirstStartActivity: Update permission check for location access

* FirstStartActivity: Ask for background_location permission

* WifiSsidPreference: More log output

* Request permission.ACCESS_FINE_LOCATION on Android 10

* RunConditionMonitor/isWifiConnectionWhitelisted: More log

* Add tip on location welcome slide for Android 10 users

* Auto-learn configured WiFi SSIDs from connected WiFi on API 29+ (fixes #514)

* Dismiss Wifi Ssid dialog after permission request

* Test on physical device under Android 9

* Revert "Test on physical device under Android 9"

This reverts commit 76a8a4a.

* Revert "Dismiss Wifi Ssid dialog after permission request"

This reverts commit 1833efb.

* Update strings.xml

* Imported de translation

* Remove empty lines
@Catfriend1
Copy link
Owner

@LordSushiPhoenix
The fix will be part of an upcoming release.
We'll go the "auto learn connected wifi ssids" approach which the app will only do if the user granted location permission (all time) and then clicks on "Select WiFi networks to whitelist" button in app settings. The permission can be revoked any time if someone feelds uncomfortable with it, but then WiFi whitelisting won't work any longer because of Google Android restrictions.

@Catfriend1
Copy link
Owner

@rogers1106
Copy link

On Android 10 it does only allow to whitelist the current network. It should offer all recently connected networks. True?

@Catfriend1
Copy link
Owner

No, Google doesn't allow to query them. Connect to each network, go to run condition Whitelist setting and then you'll be offered checkboxes for one, two, ... networks.

@rogers1106
Copy link

Ah OK, will do tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android-restriction Caused by a recently introduced android restriction bug
Projects
None yet
3 participants