Use USB API to get # of i/o ports for MIDI with USB.

Currently, the number of MIDI devices is determined using an ALSA ioctl.
This method is flaky on devices that don't simply have one input port
and one output port. This change allows us to query the number of MIDI
devices through USB instead of through an ALSA ioctl. USB MIDI should
now function correctly even with varying number of ports.

Bug: 28269065
Test: MIDI apps work for Alesis Recital and on M-Audio KeyStudio.
Android device also works as a peripheral to another Android device.

Change-Id: Id19748fbe1c8aa4913cf4925e0fec9316617409e
4 files changed