IServiceManager.getService can return NULL. Check for NULL and
return NO_INIT on failure.
Bug:
34870127
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Change-Id: I6d71f8c0e89a556e64f5250ba1ab742e485f1ebc
} else {
// Legacy IOMX
binder = sm->getService(String16("media.codec"));
+ if (binder == NULL) {
+ ALOGE("Unable to connect to media codec service");
+ return NO_INIT;
+ }
mCodecDeathListener = new ServiceDeathNotifier(binder, listener,
MediaPlayerService::MEDIACODEC_PROCESS_DEATH);
binder->linkToDeath(mCodecDeathListener);