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
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
* 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
We stopped using persist.service.adb.enable almost 4 years ago
(commit 02e4569b5f126ca916a7473117ddd17d4f2ccbbb). Delete backwards
compatibility code.
Change-Id: Ic656e834e79361b27ca2afcd3705d0523c23717d
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
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
- 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
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
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
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
- Change the package name from android.midi to android.media.midi
- Add option for specifying a Handler for DeviceCallback notifications
Change-Id: Ia9e9817a651c06299f4e02ee1da3c9666ff64cb9
Rename MidiReceiver.onPost() to post()
Change MidiManager.DeviceCallback from an interface to a class
Change-Id: I939ba7a7d82e721b90a3d80252a88e7a650c9396