Fix for MidiManager bug

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

bug: 22087661
Change-Id: Ia27835ea1197af2db04c3e7f1d2e7c9f32fddbd0
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 10e8a53..01a1c18 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -691,6 +691,9 @@
             @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));
             }});