Merge "MidiService: clear status when device unbound" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
da2247faf8
@@ -340,6 +340,11 @@ public class MidiService extends IMidiManager.Stub {
|
|||||||
|
|
||||||
IBinder binder = server.asBinder();
|
IBinder binder = server.asBinder();
|
||||||
mDevicesByServer.remove(binder);
|
mDevicesByServer.remove(binder);
|
||||||
|
// Clearing mDeviceStatus is needed because setDeviceStatus()
|
||||||
|
// relies on finding the device in mDevicesByServer.
|
||||||
|
// So the status can no longer be updated after we remove it.
|
||||||
|
// Then we can end up with input ports that are stuck open.
|
||||||
|
mDeviceStatus = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
server.closeDevice();
|
server.closeDevice();
|
||||||
|
|||||||
Reference in New Issue
Block a user