OSDN Git Service

If stopAllRecognitions is supported, do not call stopRecognition again.
authorChris Thornton <thorntonc@google.com>
Tue, 29 Aug 2017 23:46:37 +0000 (16:46 -0700)
committerChris Thornton <thorntonc@google.com>
Wed, 30 Aug 2017 22:53:37 +0000 (15:53 -0700)
Bug: 65174683
Test: NA
Change-Id: I2c179a64d4f14d0c97bc908ad83c0d964217adfd

services/soundtrigger/SoundTriggerHwService.cpp

index 8891aba..952acd7 100644 (file)
@@ -840,7 +840,7 @@ void SoundTriggerHwService::Module::setCaptureState_l(bool active)
         }
 
         const bool supports_stop_all =
-                (mHalInterface != 0) && (mHalInterface->stopAllRecognitions() == ENOSYS);
+                (mHalInterface != 0) && (mHalInterface->stopAllRecognitions() != -ENOSYS);
 
         for (size_t i = 0; i < mModels.size(); i++) {
             sp<Model> model = mModels.valueAt(i);