Make IMidiDeviceServer.setDeviceInfo method oneway
This method is called from MidiService in system server, must be
oneway.
Remove the call to IMidiDeviceServer.getDeviceInfo from
MidiService. It seems to be redundant. The reason is that
MidiDeviceInfo is only created by MidiService (to maintain
unique IDs), and after creation, it is pushed both to a remote
MidiDeviceServer, and to a local MidiService.Device class
simultaneously inside addDeviceLocked method. Thus, if
MidiService.Device.mDeviceInfo is still null, there is no chance
that remote MidiDeviceServer can hold a non-null
MidiDeviceInfo. So the call to IMidiDeviceServer.getDeviceInfo
will also return null, and thus can be avoided.
Note that only for BT MIDI devices can MidiService.Device receive
MidiDeviceInfo later in the lifecycle. All other types of devices
receive MidiDeviceInfo upon construction.
Bug: 37535382
Test: Used BT MIDI keyboard with MidiSynthDemo app
Change-Id: I5378207922187866f3c43e01f1ed30f042720167
2 files changed