def METHOD_NAME(self):
    while self._check_updates:
        container_stack = self._application.getGlobalContainerStack()
        if container_stack is None:
            time.sleep(5)
            continue
        port_list = []  # Just an empty list; all USB devices will be removed.
        if container_stack.getMetaDataEntry("supports_usb_connection"):
            machine_file_formats = [file_type.strip() for file_type in container_stack.getMetaDataEntry("file_formats").split(";")]
            if "text/x-gcode" in machine_file_formats:
                # We only limit listing usb on windows is a fix for connecting tty/cu printers on MacOS and Linux
                port_list = self.getSerialPortList(only_list_usb=Platform.isWindows())
        self._addRemovePorts(port_list)
        time.sleep(5)