void (boolean enabled) { myUpdateScheduled = null; int targetTimeout = 0; if (!enabled) { targetTimeout = readRegistryTimeoutValue(); } int currentTimeout = readCurrentTimeoutValue(); if (currentTimeout != targetTimeout) { if (!writeCurrentTimeoutValue(targetTimeout)) { myUpdateScheduled = enabled; } } }