Add support for network interface and Wi-Fi network run conditions#19
Merged
chenxiaolong merged 3 commits intomasterfrom Feb 10, 2026
Merged
Add support for network interface and Wi-Fi network run conditions#19chenxiaolong merged 3 commits intomasterfrom
chenxiaolong merged 3 commits intomasterfrom
Conversation
Previously, the only supported network-related run condition was requiring an unmetered network. This commit introduces support for run conditions based on the interface type (Wi-Fi, celluar, ethernet, other) and run conditions based on the connected Wi-Fi network. For allowing specific Wi-Fi networks, the user can choose from the system's most recent list of Wi-Fi scan results or type in their own SSID. If the user uses an esoteric non-UTF-8 SSID, that is also supported by typing in the name encoded as a hex string. The allowed network interfaces feature does not require any additional permissions. However, for the allowed Wi-Fi networks feature, the user will need to grant both the precise location and background location permissions. If the permissions are granted, but the user does not configure any allowed Wi-Fi networks, SyncthingService and DeviceStateTracker will not make use of the permissions. This commit includes a few other changes: * Launch SyncthingService in anything that uses PreferenceBaseActivity. This ensures the service is running if the user revokes a permission, causing Android to kill the app, and then returns to their previous activity. Previously, only the main settings screen behaved this way. * Split out the device event tracking logic from SyncthingService into DeviceStateTracker. This handles the watching of battery, network, and proxy settings events. * Make TextInputDialogFragment more flexible so that it can be used by all of the current textbox-based dialogs. * Fix split switch preference layout so that the switch isn't vertically cut off when the height is too short (eg. for settings that have no description). Issue: #14 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
6202741 to
b683149
Compare
This is more in line with what Android's own Wi-Fi connection screen does and is more likely to put the desired networks towards the top. Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
…haracters Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
chenxiaolong
added a commit
that referenced
this pull request
Feb 10, 2026
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the only supported network-related run condition was requiring an unmetered network. This commit introduces support for run conditions based on the interface type (Wi-Fi, celluar, ethernet, other) and run conditions based on the connected Wi-Fi network.
For allowing specific Wi-Fi networks, the user can choose from the system's most recent list of Wi-Fi scan results or type in their own SSID. If the user uses an esoteric non-UTF-8 SSID, that is also supported by typing in the name encoded as a hex string.
The allowed network interfaces feature does not require any additional permissions. However, for the allowed Wi-Fi networks feature, the user will need to grant both the precise location and background location permissions. If the permissions are granted, but the user does not configure any allowed Wi-Fi networks,
SyncthingServiceandDeviceStateTrackerwill not make use of the permissions.This commit includes a few other changes:
Launch
SyncthingServicein anything that usesPreferenceBaseActivity. This ensures the service is running if the user revokes a permission, causing Android to kill the app, and then returns to their previous activity. Previously, only the main settings screen behaved this way.Split out the device event tracking logic from
SyncthingServiceintoDeviceStateTracker. This handles the watching of battery, network, and proxy settings events.Make
TextInputDialogFragmentmore flexible so that it can be used by all of the current textbox-based dialogs.Fix split switch preference layout so that the switch isn't vertically cut off when the height is too short (eg. for settings that have no description).
Issue: #14