def _HandleProgress(cls, progress_callback):
        """Calls the callback with the current progress and total bytes written/received.

        Args:
          progress_callback: callback method that accepts filename, bytes_written and total_bytes,
                     total_bytes will be -1 for file-like objects
        """
        current = 0
        while True:
            current += yield
            try:
                progress_callback(current)
            except Exception:  # pylint: disable=broad-except
                continue
Calls the callback with the current progress and total bytes written/received.

        Args:
          progress_callback: callback method that accepts filename, bytes_written and total_bytes,
                     total_bytes will be -1 for file-like objects
        
adb/filesync_protocol.py