We were missing support for the group code, resulting in an off by 4 bytes problem.
Change-Id: I4a640c67b8d36e1bd658b6185178a71966d4b0b6
Signed-off-by: Mike Lockwood <lockwood@android.com>
MTP playlists now correspond to playlists in the media provider
(like those created by the Music app).
Change-Id: I085cb3cff003037ad62f0e297fb0cfd3047cb3a2
Signed-off-by: Mike Lockwood <lockwood@android.com>
Return MTP response codes instead of booleans for success or failure.
Remove some unused code.
Change-Id: I82ce80a4d7779233264e3caf139ebd0cece12f5c
Signed-off-by: Mike Lockwood <lockwood@android.com>
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>
Add support for detecting android MTP devices
Fix problem reading data packet with header sent separately from payload.
Change-Id: I07b34af6783ebe2e63a317796ba0c8223df86edf
Signed-off-by: Mike Lockwood <lockwood@android.com>
MTP file transfers happen in two stages. The SendObjectInfo command sends
some information about the file and reserves an ObjectHandle for the new file.
The file transfer is then performed using the SendObject command.
To support this in the media provider, MtpDatabase.beginSendObject receives
the information from SendObjectInfo and creates an row for it in the MTP objects
table for the new file. After the file transfer has completed, then
MtpDatabase.endSendObject is called. In endSendObject, we run the media scanner
on the new file, which will add a row to the images, audio, video
or audio playlist table.
To avoid the media scanner creating a second row for the file in the MTP objects
table, we pass the ObjectHandle created in beginSendObject to the media scanner,
which then passes it to the media provider via the content values when it
performs its insert.
Change-Id: I1ebcc63d6bd4404b0d3a93c703a9d3c097381d3a
Signed-off-by: Mike Lockwood <lockwood@android.com>
Uses a new "MTP objects" table in the media provider to support basic
enumeration of the external storage file system.
Support for accessing audio, video and image metadata in the existing
media provider tables will be added in a later commit.
The C++ MtpDatabase class is now abstract, to support a proxy subclass that
calls through JNI to the Java MtpDatabase class in the media provider.
Change-Id: I90f0db5f3acc5d35ae78c27a8507edff16d14305
Signed-off-by: Mike Lockwood <lockwood@android.com>
All new files and folders are created with group sdcard_rw
Permissions for new files are 0664 and directories 0775
Change-Id: I6d508231150f687e2e529112fd47f10e30fa594f
Signed-off-by: Mike Lockwood <lockwood@android.com>
Rename existing test database to MtpSqliteDatabase
This is the first step in transitioning to using the media provider database
Change-Id: I5f36c854c6e76a79137c267b000a52ced803776c
Signed-off-by: Mike Lockwood <lockwood@android.com>
Now a single thread is used for passing USB host events up to MtpClient.
Change-Id: I0e3a277956cb3d1036da122ea10acb03a27844d6
Signed-off-by: Mike Lockwood <lockwood@android.com>
This restricts the driver to the client's permissions when copying files
to avoid potential security problems.
Change-Id: I9b3151168d334fe4374875804d4ba82bef44db3b
Signed-off-by: Mike Lockwood <lockwood@android.com>
dirent.d_type is not implemented on all file systems.
Change-Id: I50a01fd77a9f976f215e7ff98dd04f0f2611bbce
Signed-off-by: Mike Lockwood <lockwood@android.com>
gold is more strict than ld. If building A depends on libB directly,
we must specify -lB at link time.
Change-Id: Iac7cec58cbae5e0cbcfc9adab924db6733192d20
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>