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

Commit 49ad5522 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

soundtrigger: Use "default" instance name for HAL service

"default" implies using "primary" legacy device module.
This doesn't change anything for binderized mode, because
the server was only registering itself as "sound_trigger.primary",
so it was the only possibility anyways.

Usage of "stub" (debugging) module is still possible
if audioflinger and corresponding services are built with
USE_LEGACY_LOCAL_AUDIO_HAL=true (added makefile check to ensure
that).

Test: "Ok Google" from screen off state on sailfish
Bug: 36570720
Change-Id: Ibef7fb312ce593d71255cfac71ba4e8f1dd28666
parent 3858e63e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

ifeq ($(SOUND_TRIGGER_USE_STUB_MODULE), 1)
    ifneq ($(USE_LEGACY_LOCAL_AUDIO_HAL), true)
        $(error Requires building with USE_LEGACY_LOCAL_AUDIO_HAL=true)
    endif
    LOCAL_CFLAGS += -DSOUND_TRIGGER_USE_STUB_MODULE
endif

+3 −3
Original line number Diff line number Diff line
@@ -252,6 +252,8 @@ int SoundTriggerHalHidl::stopAllRecognitions()
SoundTriggerHalHidl::SoundTriggerHalHidl(const char *moduleName)
    : mModuleName(moduleName), mNextUniqueId(1)
{
    LOG_ALWAYS_FATAL_IF(strcmp(mModuleName, "primary") != 0,
            "Treble soundtrigger only supports primary module");
}

SoundTriggerHalHidl::~SoundTriggerHalHidl()
@@ -265,9 +267,7 @@ sp<ISoundTriggerHw> SoundTriggerHalHidl::getService()
        if (mModuleName == NULL) {
            mModuleName = "primary";
        }
        std::string serviceName = "sound_trigger.";
        serviceName.append(mModuleName);
        mISoundTrigger = ISoundTriggerHw::getService(serviceName);
        mISoundTrigger = ISoundTriggerHw::getService();
        if (mISoundTrigger != 0) {
            mISoundTrigger->linkToDeath(HalDeathHandler::getInstance(), 0 /*cookie*/);
        }