History log of /frameworks/av/media/mtp/MtpDevice.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d4b4296b401162a7a42f757c96e3652b82255b13 04-Oct-2016 Daichi Hirono <hirono@google.com> Don't send short URB packet when sending MtpDataPacket.

When sending a MtpDataPacket to a MTP device, the kernel driver splits
it into multiple URB packets so that the URB packet size does not exceed
the buffer size at the MTP device.

Previously MtpDataPacket sends its header first, then sends the
payload. It means the first URB packet only contains the header of
MtpDataPacket and the URB packet size is smaller than the maximum URB
packet size (short packet). Some MTP devices regard the short packet as
the end of the sequencail URB packets, thus the devices do not accept
the following URB packets that contain the payload.

The MTP spec says if the responder (MTP device) sends the data in a way
where the first pacekt contains only the header, the initiator (MTP
host) must send data in the same way. Otherwise the initiator must not
send a short packet in the sequencial URB packets.

The CL fixes the MTP host implementation so that it remembers how the
MTP device sends data, and uses the same way when sending data
from the host.

Bug: 31165557
Test: Manually invokes MtpDevice#sendObject
Change-Id: Ic76eb4241ed74957414aef2990be08cd77a9f5a9
/frameworks/av/media/mtp/MtpDevice.h
8d20945c08dfdd85c252c8ba92d197bf1bd2b208 04-Oct-2016 Daichi Hirono <hirono@google.com> Stop sending object handle with sendObject request.

According to the MTP spec, the sendObject request must follow
sendObjectInfo request and we could not send an object handle with
sendObject request. The CL stops sending object handle with a sendObject
request. Instead it checks if the given object handle equals to the
object handle returned by the previous sendObjectInfo request.

Bug: 31918048
Test: manually invoked sendObjectInfo and sendObject.
Change-Id: I0a80bdf67bf2913522821ac705f3dc548d3edead
/frameworks/av/media/mtp/MtpDevice.h
7fee6ca025bf4dcac5d658e8dcd8b6cb46b4ddc3 25-Mar-2016 Daichi Hirono <hirono@google.com> Merge "Add getObjectPropValue function to MtpDevice." into nyc-dev am: 15ac558
am: fdb1d07

* commit 'fdb1d0793cd65fd760dfa197728f7971ee13b760':
Add getObjectPropValue function to MtpDevice.
66a9abef47f7c8bd438bb1897617ebad3858c736 24-Mar-2016 Daichi Hirono <hirono@google.com> Add getObjectPropValue function to MtpDevice.

In the MTP spec, the object size is stored in MtpObjectInfo as unsigned
32-bit integer and fetched by the getObjectInfo operation. For the
objects that are more than 4GB, the object size is provided as one of
extra properties, which are fetched by different operation.

The CL adds to getObjectPropValue method to MtpDevice class so that
client code can obtain 4GB+ object size from object property.

BUG=27805369

Change-Id: I0b91facd07cdc19866cb29f7df08bb1698bcf60b
/frameworks/av/media/mtp/MtpDevice.h
6197c9bff627557000cd03ece93c14a12d5c5c8d 18-Feb-2016 Daichi Hirono <hirono@google.com> Merge "Fix the return type of MtpDevice#getStorageID()."
326edd98bbc52d41de6e0943ca8a343228ed87a5 22-Jan-2016 Daichi Hirono <hirono@google.com> Add MtpDevice#getPartialObject64 method.

This is the method similar to getPartialObject but takes uint64_t as
offset.

BUG=26703522

Change-Id: I9b8b5f77225b744b527c4a78fe628e88ae89209f
/frameworks/av/media/mtp/MtpDevice.h
d7221079292b17a81ec003adef06d58019d9236d 22-Jan-2016 Daichi Hirono <hirono@google.com> Fix the return type of MtpDevice#getStorageID().

Both MtpObjectHandle and MtpStorageID are typedef of uint32_t, but
MtpStorageID is more appropriate semantically.

BUG=None

Change-Id: Ibf5bb2105c54f7b73df559132d8737c272a1cefa
/frameworks/av/media/mtp/MtpDevice.h
59a90609cc340d2933c119aa47045a5c95530b48 11-Jan-2016 Daichi Hirono <hirono@google.com> Reland "Return parameters of event as well as event code."

The CL was previously reviewed at ag/842911.

> The CL makes MtpDevice#reapEvent return event parameters as well as
> event code.
>
> BUG=26480986

Change-Id: Ie750a58248068cd0e804f20b57e7e86eef19d315
/frameworks/av/media/mtp/MtpDevice.h
4a7cea889d81bbf8f555df006fe384a405b3ba53 11-Dec-2015 Daichi Hirono <hirono@google.com> Add getPartialObject method to MtpDevice.

The CL adds getPartialObject operation to MtpDevice (host side
implementation).

BUG=26284424

Change-Id: Ia8f41b0ebb7dfb4572729eacb5902f21360c8db1
/frameworks/av/media/mtp/MtpDevice.h
8a7ffae09a019de7109b30c505561c453910bde1 20-Aug-2015 Daichi Hirono <hirono@google.com> Add functions to read MTP events from MTP devices.

BUG=23368533

Change-Id: I2003dda961339677caf56e57ae90cf6df7bd7430
/frameworks/av/media/mtp/MtpDevice.h
532b4f23c7e08fdae9fff189c4b565f6216ffd2a 25-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Fix sendObject upload.

Two issues are resolved:
- sendObject changed to accept raw arguments instead of objectinfo,
as calling getObjectInfo after sentObjectInfo is illegal,
- send buffer decreased to 16K, as this is the maximum size working
per comments in other places.

Change-Id: If71644dcbc508dd92c3fe74a2fdb7c6798059b42
/frameworks/av/media/mtp/MtpDevice.h
4fd9a8b9865addfedbcd84d5c9efea0f647086a0 20-Aug-2015 Daichi Hirono <hirono@google.com> Use common implementation for getObject and importFile.

Previously the two functions have separate but similar implementation. ag/750097
fixed a bug in importFile, but we have a same bug in getObject. Instead fixing
the bug separately, the CL adds a common function that can be used from both
getObject and importFile.

BUG=23264575

Change-Id: I0bdc876ee9b11301ba4c445cc16556e9c951a8b4
/frameworks/av/media/mtp/MtpDevice.h
025ffd9c17a7b30d862436954aa0db8d08bfaa9f 04-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Add support for reading into a file descriptor on MTP devices.

This will allow to read files on Java side without copying all bytes to
memory first, which is problematic for large files such as movies.

Bug:22908937
Change-Id: I67b116cf01d9e44af69f94c8edc64fd8fbf7b9a3
/frameworks/av/media/mtp/MtpDevice.h
ab063847e6e893740749029a04cce1f6b7345ed5 12-Nov-2014 Mike Lockwood <lockwood@google.com> MTP: add strict bounds checking for all incoming packets

Previously we did not sanity check incoming MTP packets,
which could result in crashes due to reading off the edge of a packet.
Now all MTP packet getter functions return a boolean result
(true for OK, false for reading off the edge of the packet)
and we now return errors for malformed packets.

Bug: 18113092
Change-Id: Ic7623ee96f00652bdfb4f66acb16a93db5a1c105
/frameworks/av/media/mtp/MtpDevice.h
23f1b33c5f88f07510ca5dc01b3afd7af6843d6c 30-Dec-2010 Mike Lockwood <lockwood@android.com> New APIs for MTP and PTP host support

This replaces the previous ContentProvider based interface

Change-Id: I4cea2544854adb9fdcc04345e4d73d8ef05380f3
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
42d0b79a787814d42e4c6f9dfe14f13cc0f6a758 04-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: changes to use new usb_request support in libusbhost

Change-Id: Ic091eab166a66efcde0395dcebbbc513f2322fca
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
f7454622eaac287d20ab43013d7015fe42b894f8 10-Dec-2010 Mike Lockwood <lockwood@android.com> MTP host: Handle receiving a response packet instead of data packet.

This will happen if the device needs to report an error rather than returning the data.

Change-Id: I477512b3676c2f0518a85a4135832ed4475fbc2d
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
99e393a39a31bfbdeb435462939519e2d0279433 08-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Support format argument in host GetObjectPropDesc command

Change-Id: Ic14313c0f95bea1d1d475cc6a001b256fccb91c8
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
0c7c7c76a96a82ec728a2d5c091941c4057ffb25 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Improve MtpProperty logging support

Change-Id: I46800b99763edcc5e994d912941f9f5e9b1c94d2
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
98693f674125484de8873d969c209276a6dd604b 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Host support for GetObjectPropsSupported and GetObjectPropDesc

Change-Id: I6fd23587597fc68227dfb61118b097eda3e3e1d5
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
27afe3a1cc9c07ac4884a7720087a597aea3c76f 19-Nov-2010 Mike Lockwood <lockwood@android.com> PTP: Fix permissions problems with files imported via PTP

Change-Id: I630a89c67e5b3d6d0c29e6c257f84e1909fa4de2
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
b9ff444a7eaf7ffd43970c0477110c6808bd4a7c 19-Nov-2010 Mike Lockwood <lockwood@android.com> PTP: Improve performance and reliability of file importing

Now the file copy is done completely within the media process
rather than pushing data to the client via ContProvider.openFile().

File system writes are now interleaved with USB reads, which allows us
to copy the data faster and prevents the camera from timing out during transfer.

File is automatically inserted in the media provider after a successful import
and a Uri is returned to the client.

BUG: 2994234

Change-Id: Ie75c63da76f623343d3d966c6a707aa1ae871972
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
0cf89f2e622aa53f31fa5762ca4bc805bb509ed3 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP host: Add support for reading files from an MTP device via ParcelFileDescriptor

Also added some support for sending files to the device that hasn't been debugged yet.
Add locking to MtpDevice to prevent it from attempting multiple transactions simultaneously.

Change-Id: I2b995ba0af086cc6920bd6b8c869f540ad78560a
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
b14e588bec4d5e39e61b020b5b575f2ce555d316 30-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: replace printfs with logcat

Change-Id: I2c30921098e2dc049dc5fc1e0a548ead33c363e0
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
6afc41d095ccb159f6c4705bed903b6c048b922a 11-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add host support for deleting objects.

For example, deleting pictures on a digital camera.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
3e072b354d1e1e3ee62d58492f0739139df8aff1 10-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for retrieving thumbnails to MTP content provider.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
a6c490b8b2d96ebaab632286029463f932ae3b6b 06-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: host support for retrieving device property descriptors

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h
5ed68d29a140e14c8d46980fa844548eb33b1e87 26-May-2010 Mike Lockwood <lockwood@android.com> Prototype Content Provider support for MTP/PTP devices.

At this point much of the plumbing is in place, but only a few simple queries
are supported.
This is enough to support a proof of concept sample program that navigates
the file hierarchy of a digital camera connected via USB.

Also removed obsolete ptptest host test program.

Change-Id: I17644344b9f0ce1ecc302bc0478c1f3d44a1647f
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/av/media/mtp/MtpDevice.h