Online/offline state change detection.