Check registerPassthroughServiceImplementation return status

Should abort program if registerPassthroughServiceImplementation returns
something other than OK.

Test: Play Movies & TV in non-binderized mode.

bug: 34640335
Change-Id: I94be98e7ae66cdb777a7d182123c8692aef915b7
This commit is contained in:
Edwin Wong 2017-03-16 09:40:48 -07:00
parent 0e5e908e69
commit c7170174d4

View file

@ -31,7 +31,14 @@ using android::hardware::drm::V1_0::IDrmFactory;
int main() {
ALOGD("android.hardware.drm@1.0-service starting...");
configureRpcThreadpool(8, true /* callerWillJoin */);
registerPassthroughServiceImplementation<IDrmFactory>("drm");
registerPassthroughServiceImplementation<ICryptoFactory>("crypto");
android::status_t status =
registerPassthroughServiceImplementation<IDrmFactory>("drm");
LOG_ALWAYS_FATAL_IF(
status != android::OK,
"Error while registering drm service: %d", status);
status = registerPassthroughServiceImplementation<ICryptoFactory>("crypto");
LOG_ALWAYS_FATAL_IF(
status != android::OK,
"Error while registering crypto service: %d", status);
joinRpcThreadpool();
}