void (UpdateSettings settings) { BuildNumber currentBuild = ApplicationInfo.getInstance().getBuild(); BuildNumber lastBuildChecked = BuildNumber.fromString(settings.getLastBuildChecked()); long timeSinceLastCheck = max(System.currentTimeMillis() - settings.getLastTimeChecked(), 0); if (lastBuildChecked == null || currentBuild.compareTo(lastBuildChecked) > 0 || timeSinceLastCheck >= CHECK_INTERVAL) { checkUpdates(); } else { queueNextCheck(CHECK_INTERVAL - timeSinceLastCheck); } }