Workaround to fixup MTP transcode file size
Some Windows MTP clients ignore the file size sent from the server while sending MTP objects, and instead rely on the cached MTP metadata containing the size. This causes file corruption when transcoded files are transferred from phone to PC because the file is truncated to the original file size from the cached metadata which is smaller than the transcoded file size. To workaround this, MediaProvider added an ugly workaround to the struct stat st_nlink field to signal when a file requires transcoding. In such cases, the MTP server can double the metadata size, the same heuristic used in the MediaProvider to accommodate the transcoded file size. Test: atest MtpTests Bug: 184117074 Bug: 190422448 Change-Id: I0581978fb346e3dc2d7a5204ffd7c601b61ec749
Loading
Please register or sign in to comment