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

Commit 3748258b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17259143

Change-Id: Ia1223e57d87b69f8c7e6913820c14cc8bc295ea2
parents 30561186 985c39fa
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);