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
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
index b0aef4b..996519b 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
@@ -294,8 +294,8 @@
     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 @@
     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 @@
     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