Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d04162a9 authored by John Bates's avatar John Bates Committed by Alex Vakulenko
Browse files

Use always fatal assertions in vr_composer_view and add one more

Previously vr_composer_view would never trip on its assertions.

This caused it to startup in a bad state sometimes and need to be manually
restarted.

Bug: 34807059
Test: manually
Change-Id: I4b35c95fd411e3ca8e982de511de0e5e12f18483
parent 43b5b06c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ cc_binary {
    "libbinder",
    "libhardware",
    "libhwbinder",
    "liblog",
    "libutils",
    "libvrhwc",
  ],
+8 −5
Original line number Diff line number Diff line
@@ -26,15 +26,18 @@ int main(int, char**) {

  const char instance[] = "vr_hwcomposer";
  sp<IComposer> service = HIDL_FETCH_IComposer(instance);
  LOG_FATAL_IF(!service, "Failed to get service");
  LOG_FATAL_IF(service->isRemote(), "Service is remote");
  LOG_ALWAYS_FATAL_IF(!service.get(), "Failed to get service");
  LOG_ALWAYS_FATAL_IF(service->isRemote(), "Service is remote");

  service->registerAsService(instance);
  LOG_ALWAYS_FATAL_IF(service->registerAsService(instance) != ::android::OK,
                      "Failed to register service");

  sp<IVrComposerView> composer_view = HIDL_FETCH_IVrComposerView(
      "DaydreamDisplay");
  LOG_FATAL_IF(!composer_view, "Failed to get vr_composer_view service");
  LOG_FATAL_IF(composer_view->isRemote(), "vr_composer_view service is remote");
  LOG_ALWAYS_FATAL_IF(!composer_view.get(),
                      "Failed to get vr_composer_view service");
  LOG_ALWAYS_FATAL_IF(composer_view->isRemote(),
                      "vr_composer_view service is remote");

  composer_view->registerAsService("DaydreamDisplay");