Skip to content
Commit 1cfc0c74 authored by Zim's avatar Zim Committed by Kevin Rocard
Browse files

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
parent 42bf9da7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment