summaryrefslogtreecommitdiff
path: root/media/java/android/mtp/MtpServer.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove stale method from MtpServerRay Essick2021-02-231-5/+0
| | | | | | | | | configure() called non-existent native_configure() as only action. No users found, the class is marked @hide so is not part of SDK. Bug: 180915584 Test: build Change-Id: I1c6d6d91482d4c45b8a55dd258332ba2fb69a599
* Switch to HexEncoding from ByteStringUtilsNeil Fuller2019-04-111-4/+5
| | | | | | | | | | Migration in preparation for deletion of ByteStringUtils. Also contains an import ordering change needed for upload. Bug: 124232146 Test: build only Change-Id: I0c71751de9a142a81ce43b4eaea497bf291afcbc
* MTP: remove usages of device identifiers with virtual serial numberJames Wei2019-02-201-2/+52
| | | | | | | | | | | | | | | Improving protection of user privacy Use randomly generated virtual serial number that persists until factory reset Bug: 117585389 Test: Open multiple MTP device Check MTP device property uninstall / re-install MTP driver WMP sync with multiple MTP device Enable MTP mode with multi-user Malformed MTP ID file Change-Id: I7ed4ce81d9ca1e1c6605c59c73bcd2d26419a5d3
* MTP: Add support of ObjectInfoChanged EventJames2018-07-271-0/+5
| | | | | | | | | | | | | | Under MTP mode, new file created at device side shown size zero at PC side due to file information is not updated to PC in time with ObjectAdded event Bug: 77883345 Test: 1. Take screenshot of device under MTP mode with Win10 / Linux 2. file copy, delete, rename between PC and device 3. file copy, delete, rename on device with adb shell command Test: adb shell am instrument -w android.mtp/ android.support.test.runner.AndroidJUnitRunner Change-Id: If428064fb0104b53b8afd5b050a4fab4a09312f0
* Write descriptors for Mtp in UsbServiceJerry Zhang2018-03-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current model for setting up a functionfs function is: UsbDeviceManager#setCurrentFunctions() -> intent is sent to MtpReceiver to write the descriptors -> init/hal waits for descriptors to write, then pulls up gadget -> Gadget is configured, a USB_STATE intent starts MtpServer The main downside of this is a lack of reliability because the Mtp process could be killed at any point. Normally, a gadget is unbound if its control endpoint is closed. no_disconnect works around this, but is still a little janky. In addition, the extra intent delays the startup of the gadget. With the new model, UsbDeviceManager writes the descriptors on initialization. Since it is a system service, it won't be killed. UsbDeviceManager#setCurrentFunctions() -> init/hal pulls up gadget -> Gadget is configured, a USB_STATE intent starts MtpServer MtpServer calls UsbManager#getControlFd to get a dup of the control endpoint. Also modify permissions so system server can access mtp files. Bug: 72877174 Test: Change usb configurations to ptp/mtp Change-Id: Id17d2b5930f4e1f37ec1b4f00add9d594174ad49
* resolve merge conflicts of b53d984 to masterAlex Klyubin2016-12-221-3/+22
|\ | | | | | | Change-Id: I3fe63a5c0193c720b8ec4ca53834096de8433f26
| * Make users of MtpServer fill in DeviceInfo field valuesAlex Klyubin2016-12-211-3/+21
| | | | | | | | | | | | | | | | | | This is part of weaning apps off accessing system identifiers via system properties API. Apps should use android.os.Build API instead. Bug: 33700679 Test: Enable MTP mode then check that mtp-detect output same as before this commit Change-Id: I4e6696cdee18b9c3e987c432c095911e85a997db
* | Merge "Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS ↵Jerry Zhang2016-12-131-0/+5
|\| | | | | | | | | | | | | | | drivers." am: 1975240f17 am: 830874dbe7 am: 88672d7d29 am: 11dc0eccfb Change-Id: Ibafebe4877052595cb34626bde9ac6fba1983fb0
| * Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers.Jerry Zhang2016-12-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Functionfs requires MtpServer to write descriptors before the device can be configured. This adds a new configure call that will occur only when functions are changed (new argument added to updateUsbStateBroadcast for this) and be called after sys.usb.config is changed but before the waitForState call to ensure compatibility with configfs devices. Bug: 30976142 Change-Id: I7e94a5847d3b19c0fd75139e1b15a3f2a1cea01d Test: Manual
| * Close MTP database when MtpServer's thread is terminated.Daichi Hirono2016-04-071-0/+3
| | | | | | | | | | | | Fix: 28030321 Change-Id: I7efe59b651a62ca917ba74312a80b56c0564e060 (cherry picked from commit dd383597c4bd85044bcaf23f1f16489f2c059ae0)
* | Add onTerminate runner to MtpServer.Daichi Hirono2016-07-111-2/+7
| | | | | | | | | | | | | | | | | | The CL adds onTerminate runner to MtpServer constructor's arguments to know when MtpServer stops its thread. BUG=29971895 Change-Id: I685ad6bc663f76e04ae3837129cbe12805d2093c
* | Close MTP database when MtpServer's thread is terminated.Daichi Hirono2016-04-061-0/+3
|/ | | | | Fix: 28030321 Change-Id: I7efe59b651a62ca917ba74312a80b56c0564e060
* MTP: Add support for battery level device propertyMike Lockwood2014-03-121-0/+6
| | | | | | Bug: 7342482 Change-Id: I810e55fe9695e2206816f57334ad14f65e9c641d
* AArch64: Use long for pointers in MTP classesAshok Bhat2014-01-071-1/+1
| | | | | | | | | | | | | | For storing pointers, long is used in MTP classes, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Change-Id: I67805547251722e7b77611d47d0bb632a64d3e6d Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* MTP: Clean up MtpServer initialization and threading:Mike Lockwood2011-07-131-20/+10
| | | | | | | Move thread from native to Java code Remove the stop() method (the thread will exit on its own) Change-Id: Ib897c3630162f82669a4ee8c187e8172da50b29d
* MTP: Add support for PTP variant of GetDeviceInfo result.Mike Lockwood2011-06-211-3/+3
| | | | | Change-Id: I09f86fda768b7697665e401adb9516588859bf59 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Remove obsolete setPtpMode supportMike Lockwood2011-06-081-5/+0
| | | | | | | PTP mode will be implemented as a separate USB function instead. Change-Id: I9304c1936c70604ab2ed9704c6b95e11b61f5ba2 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP and media provider support for multiple storage devices:Mike Lockwood2011-04-051-9/+11
| | | | | | | | | | | | | - 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
* MtpServer: Do not attempt to stop MTP if it has not been startedMike Lockwood2011-03-171-2/+13
| | | | | | | | | | Fixes an ANR that occurred if we got a USB disconnected event before the MTP service had started. Bug: 4118033 Change-Id: I6cad4281a5911a9926cae923f34d3a6bf98346c5 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Disable MTP when the keyguard is locked and secureMike Lockwood2011-02-221-0/+7
| | | | | | | BUG: 3402847 Change-Id: I6c77efe18f525cd0af37911c8b6aac4f17352552 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Fix race conditions in MtpServer JNI codeMike Lockwood2011-01-251-4/+0
| | | | | | | | | | Make sure previous MtpThread has exited before starting another to avoid EBUSY opening MTP kernel driver. BUG: 3317803 Change-Id: I81dcbac42bcf5f680ed1b1469839bc0b0e49d53d Signed-off-by: Mike Lockwood <lockwood@android.com>
* Remove MTP related log spamMike Lockwood2011-01-211-9/+0
| | | | | Change-Id: I9de1792cbeec07fa5ab42ff9a10813f0c3d30fc1 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Move MTP Java classes to android.mtp.* package.Mike Lockwood2010-12-301-0/+77
Change-Id: Ib18bcaabf314241a95e517d0b93be5845d988e2c Signed-off-by: Mike Lockwood <lockwood@android.com>