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

Commit ebe144c6 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudiohal: Add optional "msd" devices factory

Adding code that attempts to get an instance of "msd" devices
factory. The factory isn't yet used, but having the code in place
ensures that we would know about any changes in HIDL services
discovery protocol.

Bug: 63901775
Test: audioserver starts even if "msd" HAL service is absent
Change-Id: Ia897127ba383fc05d139b633717992a5d5a4f920
parent a4fa4760
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ DevicesFactoryHalHidl::DevicesFactoryHalHidl() {
        ALOGE("Failed to obtain IDevicesFactory service, terminating process.");
        exit(1);
    }
    // The MSD factory is optional
    mDevicesFactoryMsd = IDevicesFactory::getService(AUDIO_HAL_SERVICE_NAME_MSD);
    // TODO: Register death handler, and add 'restart' directive to audioserver.rc
}

DevicesFactoryHalHidl::~DevicesFactoryHalHidl() {
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ class DevicesFactoryHalHidl : public DevicesFactoryHalInterface
    friend class DevicesFactoryHalHybrid;

    sp<IDevicesFactory> mDevicesFactory;
    sp<IDevicesFactory> mDevicesFactoryMsd;

    static status_t nameFromHal(const char *name, IDevicesFactory::Device *device);