MidiService: Fix USB removeDeviceConnection
When MIDI USB devices are removed, removeUsbMidiDeviceLocked
is not called at the correct places.
This CL moves the check as a per Device basis. Whenever
mDeviceConnections is removed per device,
removeUsbMidiDeviceLocked should be called.
Before, we were calling addUsbMidiDeviceLocked on a Device
basis and removeUsbMidiDeviceLocked on a Client basis. This
caused incorrect behavior. The consistent behavior with this
CL allows MIDI 2.0 opens to work as expected.
Bug: 231465285
Test: Tested MIDI 2.0 app with MIDI 2.0 device
Test: Tested MIDI Keyboard with virtual device
Test: Tested MIDI Keyboard with Bluetooth MIDI
Test: Tested MIDI Keyboard with USB MIDI
Change-Id: I68567fa54b1013c6dce357f77451fe11ae2140f9
1 file changed