Okay, apparently that was too confusing. I meant the Android system wide syncing that can e.g. be toggled from Settings>Accounts>Hamburger Menu>“Auto sync data” in Marshmallow.
There is also a quick settings toggle for that.
K-9 Mail for example only syncs its email accounts when this switch is enabled, despite not having an account set at Settings>Accounts.
If this setting can somehow be accessed, we could implement another switch in Syncthing besides “Sync only when charging” and “Sync only in these networks”: “Sync only when Android Auto Sync is on”.
It seems possible to implement, but doesn’t really seem to make sense. The thing is, sync settings only work per account, so we’d have to add a “Syncthing account” to Android. And that just doesn’t make sense, because you can’t login to Syncthing in the same way you do for Google, Facebook etc.
I think it would be better to have a global pause button in the app instead, that pauses all transfers. See #254.
But if there’s multiple users on a device, perhaps there’s multiple syncthings too? (How to fill up device memory even faster and create even more contention for use of Daddy’s tablet.) But really, maybe it can make an account automatically since it’s mostly a dummy account just to hook into the global sync setting?
I think the pause all button should exist but it makes more sense to me if the global sync setting can be tied to Syncthing for this use case. Otherwise there are multiple places a user has to turn of Sync to stop all of their accounts.
K-9 Mail also manages to access the sync setting without having any accounts set up via Android’s account settings. Maybe we can have a peek at their source code? Unfortunately my code-fu is almost non-existent, so I’m not really of any use here. Sorry!
It does! When global Android sync is turned off, K-9 Mail displays “Syncing disabled” in its account view.
 Also, that would be my preferred way of handling it: An additional setting in the app that hooks onto Android’s sync setting. Like I described in my second post, Coupling syncing to Android’s sync setting.