summaryrefslogtreecommitdiff
path: root/media/java/android/mtp/MtpServer.java
AgeCommit message (Collapse)Author
2021-02-23Remove stale method from MtpServerRay Essick
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
2019-04-11Switch to HexEncoding from ByteStringUtilsNeil Fuller
Migration in preparation for deletion of ByteStringUtils. Also contains an import ordering change needed for upload. Bug: 124232146 Test: build only Change-Id: I0c71751de9a142a81ce43b4eaea497bf291afcbc
2019-02-20MTP: remove usages of device identifiers with virtual serial numberJames Wei
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
2018-07-27MTP: Add support of ObjectInfoChanged EventJames
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
2018-03-22Write descriptors for Mtp in UsbServiceJerry Zhang
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
2016-12-22resolve merge conflicts of b53d984 to masterAlex Klyubin
Change-Id: I3fe63a5c0193c720b8ec4ca53834096de8433f26
2016-12-21Make users of MtpServer fill in DeviceInfo field valuesAlex Klyubin
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
2016-12-13Merge "Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS ↵Jerry Zhang
drivers." am: 1975240f17 am: 830874dbe7 am: 88672d7d29 am: 11dc0eccfb Change-Id: Ibafebe4877052595cb34626bde9ac6fba1983fb0
2016-12-12Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers.Jerry Zhang
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
2016-07-11Add onTerminate runner to MtpServer.Daichi Hirono
The CL adds onTerminate runner to MtpServer constructor's arguments to know when MtpServer stops its thread. BUG=29971895 Change-Id: I685ad6bc663f76e04ae3837129cbe12805d2093c
2016-04-07Close MTP database when MtpServer's thread is terminated.Daichi Hirono
Fix: 28030321 Change-Id: I7efe59b651a62ca917ba74312a80b56c0564e060 (cherry picked from commit dd383597c4bd85044bcaf23f1f16489f2c059ae0)
2016-04-06Close MTP database when MtpServer's thread is terminated.Daichi Hirono
Fix: 28030321 Change-Id: I7efe59b651a62ca917ba74312a80b56c0564e060
2014-03-12MTP: Add support for battery level device propertyMike Lockwood
Bug: 7342482 Change-Id: I810e55fe9695e2206816f57334ad14f65e9c641d
2014-01-07AArch64: Use long for pointers in MTP classesAshok Bhat
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>
2011-07-13MTP: Clean up MtpServer initialization and threading:Mike Lockwood
Move thread from native to Java code Remove the stop() method (the thread will exit on its own) Change-Id: Ib897c3630162f82669a4ee8c187e8172da50b29d
2011-06-21MTP: Add support for PTP variant of GetDeviceInfo result.Mike Lockwood
Change-Id: I09f86fda768b7697665e401adb9516588859bf59 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-08MTP: Remove obsolete setPtpMode supportMike Lockwood
PTP mode will be implemented as a separate USB function instead. Change-Id: I9304c1936c70604ab2ed9704c6b95e11b61f5ba2 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-04-05MTP and media provider support for multiple storage devices:Mike Lockwood
- 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
2011-03-17MtpServer: Do not attempt to stop MTP if it has not been startedMike Lockwood
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>
2011-02-22MTP: Disable MTP when the keyguard is locked and secureMike Lockwood
BUG: 3402847 Change-Id: I6c77efe18f525cd0af37911c8b6aac4f17352552 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-25MTP: Fix race conditions in MtpServer JNI codeMike Lockwood
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>
2011-01-21Remove MTP related log spamMike Lockwood
Change-Id: I9de1792cbeec07fa5ab42ff9a10813f0c3d30fc1 Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-30Move MTP Java classes to android.mtp.* package.Mike Lockwood
Change-Id: Ib18bcaabf314241a95e517d0b93be5845d988e2c Signed-off-by: Mike Lockwood <lockwood@android.com>