Closed Bug 1036861 Opened 6 years ago Closed 6 years ago

[MTP] The file size is incorrect (0 bytes)

Categories

(Firefox OS Graveyard :: MTP/UMS, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(feature-b2g:2.1)

RESOLVED FIXED
2.1 S1 (1aug)
feature-b2g 2.1

People

(Reporter: echou, Assigned: echou)

References

Details

(Whiteboard: [ft:devices])

Attachments

(1 file, 1 obsolete file)

The file size of every single file is always "0 bytes" when I view files on my Ubuntu 13.04 via MTP.
Blocks: mtp
Depends on: 1029533
Assignee: nobody → echou
In the response of operation GetObjectInfo, there is a field "ObjectCompressedSize". Currently it's assigned with 0. We need to put correct file size into it. I also corrected the type of property value in function getObjectPropertyDesc().
Attachment #8454307 - Flags: review?(dhylands)
Comment on attachment 8454307 [details] [diff] [review]
patch 1: v1: write file size into the response of getObjectInfo

Review of attachment 8454307 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.

::: dom/system/gonk/MozMtpDatabase.cpp
@@ +634,5 @@
>    aInfo.mStorageID = entry->mStorageID;
>    aInfo.mFormat = entry->mObjectFormat;
>    aInfo.mProtectionStatus = 0x0;
> +
> +  if (entry->mObjectSize > 0xFFFFFFFFL) {

nit: since mObjectSize is uint64_t, I think that these constants should use uLL as the suffix.

i.e. 0xFFFFFFFFuLL to make the constant of a type consistant with uint64_t
Attachment #8454307 - Flags: review?(dhylands) → review+
* nit picked.

(This patch is based on the patch that Dave attached on bug 1029533. Waiting for bug 1029533 get resolved.)
Attachment #8454307 - Attachment is obsolete: true
feature-b2g: --- → 2.1
https://hg.mozilla.org/mozilla-central/rev/9c1261190829
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S1 (1aug)
Whiteboard: [ft:devices]
Component: General → MTP/UMS
You need to log in before you can comment on or make changes to this bug.