OSDN Git Service

Check registerPassthroughServiceImplementation return status
authorEdwin Wong <edwinwong@google.com>
Thu, 16 Mar 2017 16:40:48 +0000 (09:40 -0700)
committerEdwin Wong <edwinwong@google.com>
Thu, 16 Mar 2017 16:43:29 +0000 (09:43 -0700)
Should abort program if registerPassthroughServiceImplementation returns
something other than OK.

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

bug: 34640335
Change-Id: I94be98e7ae66cdb777a7d182123c8692aef915b7

drm/1.0/default/service.cpp

index d2507c4..a112aaf 100644 (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();
 }