Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
This checks that your Android device is at least Marshmallow (6.0). Your device (just) makes this. Before Android Marshmallow, MIDI connections are not supported at all.
getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_MIDI)
This checks your device actually has the MIDI feature ability. I suspect this is the reason that the menu item is locked for you. Do you have any further information on your device (model, make, etc). It could be that your device doesn't have this package as part of the operating system (it is up to manufacturers what they include or not).
What I will do is disable this last check for you (since most devices that are Android 6+ should have this feature) just in case your device is not reporting this correctly, but it might cause a crash for you when you try to connect or search for a MIDI device. For information, a WIDI Jack is the device I use in the app and it works well for me. Let's hope this change sorts it for you. Unfortunately, I'm in the middle of several code changes which means I can't push an update just now, but when the next update comes out, can you test again and let me know how you get on. I'm really hoping this will be next week at some point.
Best wishes,
Gareth