st-hal: register HIDL services if not registered
Change-Id: Ib0169d3e002e8733499c727a8107267542dead45
diff --git a/SoundTriggerDevice.cpp b/SoundTriggerDevice.cpp
index 4a7d388..cd9d616 100644
--- a/SoundTriggerDevice.cpp
+++ b/SoundTriggerDevice.cpp
@@ -470,7 +470,6 @@
/* Register LSM Lib HIDL service */
ALOGD("%s: Register LSM HIDL service", __func__);
sp<IListenSoundModel> service = new ListenSoundModel();
- configureRpcThreadpool(48, false /*callerWillJoin*/);
if(android::OK != service->registerAsService())
ALOGW("Could not register LSM HIDL service");
#endif
@@ -531,6 +530,7 @@
int status = 0;
char audio_hal_lib[100];
void *apiVersion = nullptr;
+ audio_extn_hidl_init initAudioExtn = nullptr;
ALOGD("%s: Enter", __func__);
@@ -579,6 +579,14 @@
ALOGD("%s: ahal is using API version 0x%04x", __func__,
sthal_prop_api_version_);
}
+
+ initAudioExtn = (audio_extn_hidl_init)dlsym(ahal_handle_, "check_init_audio_extension");
+ if (!initAudioExtn) {
+ ALOGW("%s: error, failed to get symbol for initAudioExtn",
+ __func__);
+ } else {
+ initAudioExtn();
+ }
return status;
error:
diff --git a/SoundTriggerPropIntf.h b/SoundTriggerPropIntf.h
index aedff6b..a2cb7a0 100644
--- a/SoundTriggerPropIntf.h
+++ b/SoundTriggerPropIntf.h
@@ -169,4 +169,7 @@
/* AHAL extn util function which is called by STHAL */
typedef void (*audio_hw_close_snd_mixer_t)(struct mixer *mixer);
+
+/* AHAL extn util function which is called by STHAL */
+typedef void (*audio_extn_hidl_init)();
#endif /* SOUND_TRIGGER_PROP_INTF_H */