diff options
author | Mikhail Naganov <mnaganov@google.com> | 2017-04-13 11:00:11 -0700 |
---|---|---|
committer | Mikhail Naganov <mnaganov@google.com> | 2017-04-14 15:52:11 +0000 |
commit | 3acaa668c102cf096a9e3bc540d7a74ca3ac5c36 (patch) | |
tree | 49cb3c43035a83bbcf6bbe144de608758694d78a /soundtrigger/2.0 | |
parent | be31e7c571f4255cc804b4fb0ee77a31773188d8 (diff) | |
download | platform_hardware_interfaces-3acaa668c102cf096a9e3bc540d7a74ca3ac5c36.tar.gz platform_hardware_interfaces-3acaa668c102cf096a9e3bc540d7a74ca3ac5c36.tar.bz2 platform_hardware_interfaces-3acaa668c102cf096a9e3bc540d7a74ca3ac5c36.zip |
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: I88f1ebd4c1efd0f91e37458746c336a4beef33ae
Diffstat (limited to 'soundtrigger/2.0')
-rw-r--r-- | soundtrigger/2.0/default/SoundTriggerHalImpl.cpp | 22 | ||||
-rw-r--r-- | soundtrigger/2.0/default/SoundTriggerHalImpl.h | 2 |
2 files changed, 5 insertions, 19 deletions
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp index b0aef4bc2e..996519b2b8 100644 --- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp +++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp @@ -294,8 +294,8 @@ exit: return ret; } -SoundTriggerHalImpl::SoundTriggerHalImpl(const char *moduleName) - : mModuleName(moduleName), mHwDevice(NULL), mNextModelId(1) +SoundTriggerHalImpl::SoundTriggerHalImpl() + : mModuleName("primary"), mHwDevice(NULL), mNextModelId(1) { } @@ -304,9 +304,6 @@ void SoundTriggerHalImpl::onFirstRef() const hw_module_t *mod; int rc; - if (mModuleName == NULL || strlen(mModuleName) == 0) { - mModuleName = "primary"; - } rc = hw_get_module_by_class(SOUND_TRIGGER_HARDWARE_MODULE_ID, mModuleName, &mod); if (rc != 0) { ALOGE("couldn't load sound trigger module %s.%s (%s)", @@ -570,20 +567,9 @@ void SoundTriggerHalImpl::convertPhraseRecognitionExtraFromHal( delete[] levels; } -ISoundTriggerHw *HIDL_FETCH_ISoundTriggerHw(const char *name) +ISoundTriggerHw *HIDL_FETCH_ISoundTriggerHw(const char* /* name */) { - if (name != NULL) { - if (strncmp(SOUND_TRIGGER_HARDWARE_MODULE_ID, name, - strlen(SOUND_TRIGGER_HARDWARE_MODULE_ID)) != 0) { - return NULL; - } - name = strchr(name, '.'); - if (name == NULL) { - return NULL; - } - name++; - } - return new SoundTriggerHalImpl(name); + return new SoundTriggerHalImpl(); } } // namespace implementation } // namespace V2_0 diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.h b/soundtrigger/2.0/default/SoundTriggerHalImpl.h index 8aa9285a48..4769590ae7 100644 --- a/soundtrigger/2.0/default/SoundTriggerHalImpl.h +++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.h @@ -38,7 +38,7 @@ using ::android::hardware::soundtrigger::V2_0::ISoundTriggerHwCallback; class SoundTriggerHalImpl : public ISoundTriggerHw { public: - explicit SoundTriggerHalImpl(const char *moduleName = NULL); + SoundTriggerHalImpl(); // Methods from ::android::hardware::soundtrigger::V2_0::ISoundTriggerHw follow. Return<void> getProperties(getProperties_cb _hidl_cb) override; |