ANDROID: usb: gadget: f_midi: rework cleanup path
An issue was found where a device is unable to switch USB mode after selecting MIDI functionality. The userspace switch logic was found to be different than expected, and therefore a complete device removal is not appropriate for the disable case. Instead, implement an info clear function to uninitialize the midi information during teardown, but do not remove the android midi device until the f_midi instance is freed. Steps to reproduce the original issue: 1. Connect the Android device via USB cable to the computer. 2. Open the USB Preference dialog box to change the USB function. 3. Select the MIDI function. 4. Select the MTP, PTP, or other desired USB function. 5. Wait a moment for the USB function UI to become inactive and unable to switch. Test: manually tested the above steps, and successfully switch between USB modes. Bug: 322732675 Bug: 120441124 Signed-off-by:Neill Kapron <nkapron@google.com> (cherry picked from https://android-review.googlesource.com/q/commit:d399811b2a58e0ade271ea9d1ef78f89c8926523) Merged-In: Ie291e44ab5d6d194da6b488d0d2e533b9f3c538a Change-Id: Ie291e44ab5d6d194da6b488d0d2e533b9f3c538a
Loading