Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 985c39fa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "USB MIDI: Add null check on device removal" into tm-dev

parents 51f14d25 b6a1953f
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -496,12 +496,14 @@ public class UsbHostManager {
                // MIDI
                ArrayList<UsbDirectMidiDevice> midiDevices =
                        mMidiDevices.remove(deviceAddress);
                if (midiDevices != null) {
                    for (UsbDirectMidiDevice midiDevice : midiDevices) {
                        if (midiDevice != null) {
                        Slog.i(TAG, "USB MIDI Device Removed: " + deviceAddress);
                            IoUtils.closeQuietly(midiDevice);
                        }
                    }
                    Slog.i(TAG, "USB MIDI Devices Removed: " + deviceAddress);
                }

                getCurrentUserSettings().usbDeviceRemoved(device);
                ConnectionRecord current = mConnected.get(deviceAddress);