summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpServer.h
Commit message (Collapse)AuthorAgeFilesLines
* MtpServer: Fix concurrent access to mStoragesTom Marshall2016-06-071-2/+4
| | | | | | | | | | | * getStorage is called both internally with mMutex held and externally without mMutex held. Create getStorageLocked for internal use and make getStorage a wrapper. * hasStorage is only called internally with mMutex held. Make it a private method. Change-Id: I8f73310ad6cca14cd88b8e29f20cc181b3a4fac3
* Screenshots info is not updated when device is plugged in MTP modeMaunik Shah2015-10-311-0/+1
| | | | | | | | | | When device is connected as MTP mode and user opens folder /sdcard/Pictures/Screenshots/ in windows system and captures new screenshot, image information is always shown as 0 KB Issue: https://code.google.com/p/android/issues/detail?id=56204 Change-Id: I86d8e1ee54c0d8b2008b5f6bc0de2cac3faafc20
* MTP: Add support for device property changed eventsMike Lockwood2014-03-111-0/+1
| | | | | | | Also fixed bug in MtpProperty::write() for device properties Bug: 7342482 Change-Id: If0099095d101409d131564e55b1939895c69c202
* MTP: Add support for PTP variant of GetDeviceInfo result.Mike Lockwood2011-06-211-1/+4
| | | | | Change-Id: I09f86fda768b7697665e401adb9516588859bf59 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Implement GetThumb commandMike Lockwood2011-04-251-0/+1
| | | | | | | | | This allows the PC to access thumbnails in JPEG files over MTP/PTP Bug: 3219495 Change-Id: I4964f8b4826dffb7f0f77464ec91bd2e97a2f007 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Fix file descriptor leak in file editing extensionsMike Lockwood2011-04-251-6/+16
| | | | | Change-Id: I6d0de5efe705d8060bbfd526c6880dc995a3aa30 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Add extended operations to support in-place editing of filesMike Lockwood2011-04-221-1/+22
| | | | | | | | | | | | | | | | | | | | | | MTP does not support partial writes of files (the entire file must be transferred at once). This makes it impossible to implement a FUSE file system for MTP with acceptable performance. To fix this problem, this change adds extended MTP operations to allow partial writes to files: SendPartialObject - allows writing a subset of a file, or appending to the end of a file TruncateObject - allows changing the size of a file BeginEditObject - must be called before using SendPartialObject and TruncateObject EndEditObject - commits changes to a file after it has been edited with SendPartialObject or TruncateObject We also add GetPartialObject64, which is the same as GetPartialObject but has a 64 bit offset rather than 32. Change-Id: I4b110748b97ae05cdc8aab02ecdbbbeb263f7840 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP and media provider support for multiple storage devices:Mike Lockwood2011-04-051-3/+3
| | | | | | | | | | | | | - MTP support for multiple storage units - Add storage_id column to media database for MTP storage ID - Add framework resource for defining mount points and user visible descriptions for multiple volumes - Clean up locking in MtpServer JNI code Change-Id: Iffb66ed156ef5bc80b14228af78fbacee7734360
* MTP: Add support for dynamically adding and removing storage unitsMike Lockwood2011-02-221-4/+14
| | | | | | BUG: 3402847 Change-Id: I7da266061d949abcb6bb11c6faaa47b5e4a2a977
* MTP: Add support for reserve storage setting to avoid low storage situations.Mike Lockwood2010-12-121-1/+1
| | | | | | | | | | | | | Set resource config_mtpReserveSpaceMegabytes to number of megabytes to reserve. If MTP has dedicated storage this value should be zero, but if MTP is sharing storage with the rest of the system, set this to a positive value to ensure that MTP activity does not result in the storage being too close to full. BUG: 3250924 Change-Id: I881c87240da268bad1ea1b99ad03673ab85ffdbf Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Implement GetPartialObject commandMike Lockwood2010-11-231-0/+1
| | | | | | | Allows host to read partial contents of files on the device Change-Id: I74927f7394224d674e1d150a4b72a51d9358459b Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Partial implementation of the GetObjectPropList commandMike Lockwood2010-11-151-0/+1
| | | | | | | | | | In this initial implementation we only support fetching one property at a time. Support depth = 0 (single object) or depth = 1 (all objects in a directory) Reimplemented GetObjectPropValue on top of GetObjectPropList, since the former is a special case of the latter. Change-Id: Ia76ee61741d6ee3902b5c5d9fc094cf86dfaf650 Signed-off-by: Mike Lockwood <lockwood@google.com>
* MTP: work in progress on expanded property supportMike Lockwood2010-08-251-9/+5
| | | | | | | | GetObjectPropValue and SetObjectPropValue are disabled until I figure out why Windows doesn't like what I have done. Change-Id: I74e945ef3ea031f6d46f4ebaa8df815da0a5c3ed Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Add support for syncing MTP playlistsMike Lockwood2010-08-031-0/+2
| | | | | | | | 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>
* MTP: Implement GetNumObjectsMike Lockwood2010-08-021-0/+1
| | | | | Change-Id: Iccc3a445f9a1eab7bb76eddd567c6a3a8f155b2b Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Add support for sending events to the host when objects are added and ↵Mike Lockwood2010-07-131-0/+5
| | | | | | | removed Change-Id: Ia1d5232b919c644c670ff9ca651eca92b3f9ad42 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Integrate host to device file transfer with the media provider.Mike Lockwood2010-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* Remove some scafolding and test code that is no longer worth maintaining.Mike Lockwood2010-07-091-1/+0
| | | | | Change-Id: I9ee62d2463d8df1246a84774e8ac7e674778279a Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Use media provider database to implement MTP device support.Mike Lockwood2010-07-081-7/+4
| | | | | | | | | | | | | 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>
* MTP: Fix ownership and file permissions for transferred files and foldersMike Lockwood2010-07-021-1/+8
| | | | | | | | 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>
* MTP: Make MtpDatabase class abstract so we can have multiple implementationsMike Lockwood2010-07-021-2/+2
| | | | | | | | 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>
* MTP: Implement GetObjectPropDescMike Lockwood2010-06-301-0/+9
| | | | | Change-Id: I283651257254fc9cd9d93eab4605c5e33d3db93e Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Add support for host cancellation of file transfers.Mike Lockwood2010-06-041-1/+1
| | | | | Change-Id: I72df423f8017286e41adae525e6fbcb6b8440687 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Move MTP code to the android namespaceMike Lockwood2010-05-141-0/+4
| | | | | Change-Id: I5da48038fd5e4cdeefaeba42cdc74eb588b3448d Signed-off-by: Mike Lockwood <lockwood@android.com>
* Checkpoint work on MTP and PTP investigation.Mike Lockwood2010-05-131-0/+86
This change includes work in progress on a C++ library for both host and device MTP and PTP support. Currently the makefile builds two test programs: mtptest - a command line test program that implements a small subset of device side MTP. Requires a kernel driver that has not been checked in yet. ptptest - a host tool to test USB host support for detecting and communicating with digital cameras over PTP. Runs on Linux host. Later this will be reformulated as a native library that will be used in the media process. Change-Id: I81aab279975b600b59d99013ab97f9adf0b58da7 Signed-off-by: Mike Lockwood <lockwood@android.com>