Fix for MidiManager bug

Returning null if MidiManager service can't be created instead
of crashing with NPE.

bug: 22087661
Change-Id: Ia27835ea1197af2db04c3e7f1d2e7c9f32fddbd0
This commit is contained in:
Ricardo Garcia
2015-07-16 18:20:46 -07:00
parent e40d7a6326
commit 47abda576e

View File

@@ -691,6 +691,9 @@ final class SystemServiceRegistry {
@Override
public MidiManager createService(ContextImpl ctx) {
IBinder b = ServiceManager.getService(Context.MIDI_SERVICE);
if (b == null) {
return null;
}
return new MidiManager(IMidiManager.Stub.asInterface(b));
}});