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

Commit 85f8a73d authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix clang-tidy warnings in soundtrigger.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: I28b251c99c78286a2da1e039df470a3f0bd8abe2
parent 67fbddfd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ status_t SoundTriggerHwService::setCaptureState(bool active)
}


void SoundTriggerHwService::detachModule(sp<Module> module)
void SoundTriggerHwService::detachModule(const sp<Module>& module)
{
    ALOGV("detachModule");
    AutoMutex lock(mServiceLock);
+3 −3
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public:

       sound_trigger_hw_device *hwDevice() const { return mHwDevice; }
       struct sound_trigger_module_descriptor descriptor() { return mDescriptor; }
       void setClient(sp<ISoundTriggerClient> client) { mClient = client; }
       void setClient(const sp<ISoundTriggerClient>& client) { mClient = client; }
       void clearClient() { mClient.clear(); }
       sp<ISoundTriggerClient> client() const { return mClient; }
       wp<SoundTriggerHwService> service() const { return mService; }
@@ -156,7 +156,7 @@ public:
    class CallbackThread : public Thread {
    public:

        CallbackThread(const wp<SoundTriggerHwService>& service);
        explicit CallbackThread(const wp<SoundTriggerHwService>& service);

        virtual             ~CallbackThread();

@@ -176,7 +176,7 @@ public:
        Vector< sp<CallbackEvent> > mEventQueue;
    };

           void detachModule(sp<Module> module);
           void detachModule(const sp<Module>& module);

    static void recognitionCallback(struct sound_trigger_recognition_event *event, void *cookie);
           sp<IMemory> prepareRecognitionEvent_l(struct sound_trigger_recognition_event *event);