src/vs/platform/telemetry/common/serverTelemetryService.ts/ServerTelemetryService/updateInjectedTelemetryLevel
class ServerTelemetryService:	async updateInjectedTelemetryLevel(telemetryLevel: TelemetryLevel): Promise<void> {
		if (telemetryLevel === undefined) {
			this._injectedTelemetryLevel = TelemetryLevel.NONE;
			throw new Error('Telemetry level cannot be undefined. This will cause infinite looping!');
		}
		// We always take the most restrictive level because we don't want multiple clients to connect and send data when one client does not consent
		this._injectedTelemetryLevel = this._injectedTelemetryLevel ? Math.min(this._injectedTelemetryLevel, telemetryLevel) : telemetryLevel;
		if (this._injectedTelemetryLevel === TelemetryLevel.NONE) {
			this._telemetryCache = [];
			this.dispose();
		} else {
			// Level was set we're no longer in a pending state we flush the telemetry cache.
			return this.flushTelemetryCache();
		}
	}