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

Commit aa011ee0 authored by Chris Phoenix's avatar Chris Phoenix Committed by Yifan Hong
Browse files

Vr HAL uses "default" service name

The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934

Change-Id: I2bd735cff9674ec5955ae30efed27359041ed723
parent 8c171a5c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -42,16 +42,16 @@ Return<void> Vr::setVrMode(bool enabled) {
    return Void();
}

IVr* HIDL_FETCH_IVr(const char *name) {
IVr* HIDL_FETCH_IVr(const char * /*name*/) {
    vr_module_t *vr_module;
    const hw_module_t *hw_module = NULL;

    int ret = hw_get_module(name, &hw_module);
    int ret = hw_get_module(VR_HARDWARE_MODULE_ID, &hw_module);
    if (ret == 0) {
        return new Vr(reinterpret_cast<vr_module_t*>(
                const_cast<hw_module_t*>(hw_module)));
    } else {
        ALOGE("hw_get_module %s failed: %d", name, ret);
        ALOGE("hw_get_module %s failed: %d", VR_HARDWARE_MODULE_ID, ret);
        return nullptr;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -23,5 +23,5 @@ using android::hardware::vr::V1_0::IVr;
using android::hardware::defaultPassthroughServiceImplementation;

int main() {
    return defaultPassthroughServiceImplementation<IVr>("vr");
    return defaultPassthroughServiceImplementation<IVr>();
}
+1 −3
Original line number Diff line number Diff line
@@ -26,13 +26,11 @@ using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;

#define VR_SERVICE_NAME "vr"

// The main test class for VR HIDL HAL.
class VrHidlTest : public ::testing::Test {
 public:
  void SetUp() override {
    vr = IVr::getService(VR_SERVICE_NAME);
    vr = IVr::getService();
    ASSERT_NE(vr, nullptr);
  }