The Autosync Changed trigger fires when the auto sync (automatic background data syncing) setting on the device changes. This allows you to respond when the user enables or disables automatic synchronization for accounts.

Options

  • Enabled - Trigger fires when auto sync is turned on
  • Disabled - Trigger fires when auto sync is turned off

Examples

Example 1: Notification When Sync Disabled

Triggers

Autosync Changed (Disabled)
Actions

Notification: Auto sync has been disabled

Example 2: Log Sync State Changes

Triggers

Autosync Changed (Enabled)
Actions

Write to File: Auto sync enabled at {hour:minute:second}

Notes

  • The trigger monitors the Master Sync Automatically setting via the ContentResolver
  • Only one option can be selected per trigger instance - create separate triggers if you need to respond to both enabling and disabling
  • The trigger uses a status change listener to efficiently monitor the setting without polling
  • The trigger only fires when the state actually changes (not on repeated settings to the same value)
  • This monitors the global auto sync setting, not individual account sync settings

See Also