summaryrefslogtreecommitdiffstats
path: root/services/usb
Commit message (Collapse)AuthorAgeFilesLines
* Merge "remove setLatestEventInfo from USB" into mnc-devChris Wren2015-06-151-28/+30
|\
| * remove setLatestEventInfo from USBChris Wren2015-06-121-28/+30
| | | | | | | | | | Bug: 18510449 Change-Id: I6b9ccaa0537c8044c5fa900ae4ea68b2676e1365
* | UsbDeviceManager: Modify default function handlingNick Kralevich2015-06-121-3/+3
|/ | | | | | | | | | | | | | When adb is enabled, there's no need to also enable MTP mode. ADB mode enabled is sufficient to get connect messages from the kernel driver. This change modifies getDefaultFunctions() to return adb mode if adb is enabled, but mtp when it's not enabled. Also stop using "none" mode as the default. "none" should only be used when toggling the driver. Bug: 21429947 Change-Id: I767491417c6c69a120fcf4f3d6ec0c73311a1a60
* Fix USB access control when adb is disabled.Nick Kralevich2015-06-102-3/+49
| | | | | | | | | | | | | | | | | | | | When adb is disabled, the default usb mode would be "none", which would turn off the driver and prevent UsbDeviceManager from receiving any new USB connect / disconnect messages. This prevents the user from ever enabling MTP and sharing data when adb is turned off. As discussed in bug 21429947, we work around this problem by keeping the USB driver in MTP mode most of the time, so that we continue to receive USB connect / disconnect messages. To avoid leaking confidential user photos, this change introduces an unlocked state. Setting the mtp enabled function is now decoupled from exposing data on the USB connection. Only if MTP is enabled and USB data has been unlocked is confidential user data allowed to be shared. Bug: 21429947 Change-Id: Iefb5c7e22dc4962bf5226f2ed3d0155b5c7b413c
* UsbMidiDevice: Only keep ALSA devices open when device is in useMike Lockwood2015-06-081-59/+170
| | | | | | | | This should fix contention problems for apps using USB APIs to implement MIDI support Bug: 20949468 Bug: 21630625 Change-Id: I32b44330ca0310a4693fd56a4b01ad399f82c1c9
* Merge "UsbDeviceManager: Don't unnecessarily touch properties" into mnc-devNick Kralevich2015-06-031-3/+16
|\
| * UsbDeviceManager: Don't unnecessarily touch propertiesNick Kralevich2015-06-021-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before setting the properties persist.sys.usb.config or sys.usb.config, check the existing values. If the values are the same as what we'd set it to, don't perform the set. Any USB property set, even if setting the property to the value it already has, triggers one of the "on property" triggers in system/core/rootdir/init.usb.rc . The script then reconfigures the driver unnecessarily, which causes instability and dropped connections when trying to use ADB. Avoid this instability by not performing property sets which would have no effect. Bug: 21404762 Bug: 18905620 Change-Id: Id3c2543308df994a0114a0661e20ca799c2dc0e8
* | usb debugging: show alert to secondary userXiaohui Chen2015-06-031-16/+29
|/ | | | | Bug: 12785423 Change-Id: If7f60899cfdaca7bdad560bd59a78f5be74c24be
* Turning off logging in ALSA device connection routines.Paul McLean2015-05-191-1/+1
| | | | | bug: 21298614 Change-Id: Ia88393698072af8f7c101382f180192646bf713e
* Pass charset to XmlPullParser.setInput instead of nullWojciech Staszkiewicz2015-05-141-3/+4
| | | | | | | | | Passing null to XmlPullParser.setInput forces it to do additional work, which can be easily avoided if we know the charset beforehand. bug: b/20849543 Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
* Modify how USB connections are handled.Nick Kralevich2015-05-132-130/+47
| | | | | | | | | | | | | | | * Introduce a new "charger only" mode. In this mode, MTP is disabled, and no file transfers can occur. * Make charger only mode the default. * Modify "persist.sys.usb.config" so it now only holds the adb status. * Make the USB settings non-persistent. Unplugging the USB connection will reset the device back to "charger only" mode. * Fixup wording per UI guidelines. TODO: Re-implement MDM restrictions for USB / MTP access controls. Bug: 18905620 Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
* UsbManager / UsbService / UsbDeviceManager: delete unused codeNick Kralevich2015-05-102-23/+0
| | | | | | These functions are never called. Change-Id: Ic436e1036bed717d2c64701fddd9a810abb9443e
* MidiDeviceInfo: Add version string propertyMike Lockwood2015-04-291-0/+2
| | | | | | For USB devices, this is populated with the USB device version string. Change-Id: Ia9286d5f41783e4e960a9c724bf6b85b6599fe12
* UsbDevice: Add support for retrieving version string for a USB deviceMike Lockwood2015-04-291-2/+5
| | | | Change-Id: Ia8630f5ffd05f90347b971110a81f4927060cc4b
* UsbAlsaManager: Fix NPE when running in emulatorMike Lockwood2015-04-241-2/+4
| | | | | Bug: 20537358 Change-Id: I46693e45eb6127118cbd54fc3490dc58840b5797
* Add user visible name for USB peripheral MIDI deviceMike Lockwood2015-04-101-1/+3
| | | | Change-Id: I075a54dc3890bc5cf3927cecba3750e1d342d290
* Add support for flushing MIDI all scheduled MIDI events on a portMike Lockwood2015-04-091-28/+38
| | | | Change-Id: I39d7862540d4d4b9e2df1265f9dd253541adb4c2
* Add event scheduling support to USB MIDI Manager codeMike Lockwood2015-03-311-17/+43
| | | | Change-Id: I9fdaaac35c296acc67ee0cf346b0c7b56bf58393
* Move MIDI utilities for internal use to com.android.internal.midi packageMike Lockwood2015-03-301-1/+0
| | | | Change-Id: I7393ae1d4bca61667fb6ee809a7aa22c5c48de56
* Make the MIDI Manager optional, enabled by "android.software.midi" featureMike Lockwood2015-03-271-1/+8
| | | | Change-Id: I76d442ea28beea4b9e2876bfef501d8f61403702
* Merge "UsbDeviceManager: delete obsolete code"Nick Kralevich2015-03-261-12/+0
|\
| * UsbDeviceManager: delete obsolete codeNick Kralevich2015-03-251-12/+0
| | | | | | | | | | | | | | | | We stopped using persist.service.adb.enable almost 4 years ago (commit 02e4569b5f126ca916a7473117ddd17d4f2ccbbb). Delete backwards compatibility code. Change-Id: Ic656e834e79361b27ca2afcd3705d0523c23717d
* | MIDI Manager: remove USB peripheral MIDI device when USB is disconnectedMike Lockwood2015-03-253-14/+19
|/ | | | | | | | | Otherwise, the MIDI device would appear available always, rather than only when USB is connected. Also fixed file descriptor leak in UsbMidiDevice Change-Id: I0d38e81c488de4748eef36ca359635fa59e0e636
* Replace usages of deprecated Resources.getColor() and getColorStateList()Alan Viverette2015-03-181-2/+2
| | | | Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
* Merge "Add MidiManager to public API"Mike Lockwood2015-03-141-3/+2
|\
| * Add MidiManager to public APIMike Lockwood2015-03-131-3/+2
| | | | | | | | | | | | Also made some small API changes based on feedback from the lint tool. Change-Id: Ibcf1e9107d86d3a364f811ce47a13aa0da653366
* | Merge "MidiDeviceInfo meta-data improvements:"Mike Lockwood2015-03-132-5/+15
|\ \ | |/
| * MidiDeviceInfo meta-data improvements:Mike Lockwood2015-03-122-5/+15
| | | | | | | | | | | | | | | | Add property for user visible device name Add names for input and output ports Rename "model" to "product" to match USB specification. Change-Id: I8dc50da935f26825ffc73de456d34e7933aa987c
* | AudioService: Write base stream volume changes to the event log.John Spurlock2015-03-121-2/+2
|/ | | | | | | | | | | | - Add a new volume_changed event, reported at the stream level. - Only include changes to base streams (no aliases). - Include the caller for each change. A caller is either: - a pkg name (for external calls or known media sessions) - a system server class's log tag (for internal calls, disambiguates "android") Bug: 19599935 Change-Id: Ia61b68ff1e7e2907a24972790ec052bfe099e665
* Merge "MidiManager: Add MIDI device status notifications"Mike Lockwood2015-03-111-1/+1
|\
| * MidiManager: Add MIDI device status notificationsMike Lockwood2015-03-111-1/+1
| | | | | | | | | | | | | | | | | | MidiManager clients can be notified of device status changes via a new MidiDeviceStatus object. MidiDeviceStatus contains the busy status of the device's input ports and number of connections to the output ports. MidiDeviceService now has an optional callback for receiving notifications when its ports change as well. Change-Id: I1600df4464d82724bc026c27b9633ae9c412d3f0
* | Merge "Add MidiReceiver.send() and MidiReceiver.getMaxMessageSize()"Mike Lockwood2015-03-111-1/+1
|\ \ | |/
| * Add MidiReceiver.send() and MidiReceiver.getMaxMessageSize()Mike Lockwood2015-03-111-1/+1
| | | | | | | | Change-Id: I10d4f5e2400fcaf41f455e56ca25bbc0c781a042
* | Handle simultaneous connect of devices with the same "type" (as in USB)Paul McLean2015-03-101-28/+23
|/ | | | | Change-Id: I163bf8e33ccf5aacc7ba21775916727430327f18 Bug: 19563570
* Make MidiSender and MidiReceiver abstract classes, rename ↵Mike Lockwood2015-03-041-2/+2
| | | | | | MidiReceiver.post() to receive() Change-Id: I1cef3bd48ca0acf2968c9de223f78445f3434404
* Eliminate MidiPort base class for MidiInputPort and MidiOutputPortMike Lockwood2015-03-041-2/+3
| | | | Change-Id: I628c0468ac980eee909add53a4d6e55e9b358603
* Merge "MidiManager: Virtual MIDI devices are now implemented as Services"Mike Lockwood2015-03-051-30/+39
|\
| * MidiManager: Virtual MIDI devices are now implemented as ServicesMike Lockwood2015-03-041-30/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To implement a virtual MIDI device, include a subclass of MidiDeviceService in your application. This service is identified by an intent filter and meta-data in the application's manifest to allow the MIDI manager to register the virtual device without actually running the application. Instead, the application's MidiDeviceService subclass is started on demand when MIDI manager clients want to open the device. Here is an example of how the MidiDeviceService might be described in the application manifest: <service android:name="VirtualDeviceService"> <intent-filter> <action android:name="android.media.midi.MidiDeviceService" /> </intent-filter> <meta-data android:name="android.media.midi.MidiDeviceService" android:resource="@xml/device_info" /> </service> and the device_info.xml meta-data: <devices> <device manufacturer="Sample Manufacturer" model="Sample Model" private="false"> <input-port name="my input port" /> <output-port name="my output port" /> </device> </devices> (note that the <input-port> and <output-port> names are not currently used, but support for these will be added in a subsequent change) Client's of the virtual device will bind directly to the hosting application's MidiDeviceService subclass. To support this, MidiManager.openDevice() now returns the MidiDevice asynchronously via a callback. This change also adds a utility class called MidiDispatcher, which is a MidiReceiver that dispatches all data it receives to a list of other MidiReceivers. We now use this internally in MidiInputPort and MidiDeviceServer, but developers may use it for other purposes as well. Change-Id: Ic3009f06d56f3d5edbd87de3f0c330b51a1c217d
* | Fix a regression in UsbDebuggingManagerAmith Yamasani2015-03-041-1/+1
| | | | | | | | | | | | | | Catch NPE as well if socket object is null. Bug: 19602060 Change-Id: I7cf9cb16abc3fde626170c1aefeba5fc91c5734f
* | Merge "Remove unused imports in frameworks/base."John Spurlock2015-03-025-9/+0
|\ \ | |/ |/|
| * Remove unused imports in frameworks/base.John Spurlock2015-02-285-9/+0
| | | | | | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* | Merge "Avoid NPE when quickly toggling USB debugging state"Amith Yamasani2015-03-021-69/+123
|\ \ | |/ |/|
| * Avoid NPE when quickly toggling USB debugging stateAmith Yamasani2015-03-021-69/+123
| | | | | | | | | | | | | | | | | | | | | | | | If you try to disable USB debugging before the socket to listen is opened in the thread, it will end up with an NPE. Do some locking around socket creation and closing to avoid this. Bug: 18708503 Change-Id: Iac43e4806fff1e411772b1ba1a070d8a7c776fcb
* | Move ALSA utilities to com.android.internal.alsa packageMike Lockwood2015-02-261-2/+2
| | | | | | | | Change-Id: Icbd45ec97a942e44e60f8d4ba0bb58c97f85b55f
* | Add MIDI Manager API tweaks:Mike Lockwood2015-02-233-8/+7
| | | | | | | | | | | | | | | | - Change the package name from android.midi to android.media.midi - Add option for specifying a Handler for DeviceCallback notifications Change-Id: Ia9e9817a651c06299f4e02ee1da3c9666ff64cb9
* | Add support for USB notification when connected as a MIDI peripheralMike Lockwood2015-02-201-0/+2
|/ | | | Change-Id: Ib3efcda6af976c878e63b0d35a8e47a3ea9435a3
* Audio Device Enumeration API.Paul McLean2015-02-191-2/+2
| | | | Change-Id: Ic78fda8b2a6f6ac0f37a1f665b29f3359cfc5ecc
* Merge "MidiManager API tweaks:"Mike Lockwood2015-02-131-2/+2
|\
| * MidiManager API tweaks:Mike Lockwood2015-02-121-2/+2
| | | | | | | | | | | | | | | | Rename MidiReceiver.onPost() to post() Change MidiManager.DeviceCallback from an interface to a class Change-Id: I939ba7a7d82e721b90a3d80252a88e7a650c9396
* | Move AudioService to services.John Spurlock2015-02-091-1/+2
| | | | | | | | | | | | ...and a few dependencies. Move remaining shared items to AudioSystem. Change-Id: Ib9623ff867678d34977337856bb0156e8cdaeeb5