Fix clang-tidy warnings in audio and playerservice.
* 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: I265f3b094e08d5705b506b3fbba51439c134af84
Merged-In: I265f3b094e08d5705b506b3fbba51439c134af84
diff --git a/services/audioflinger/PatchPanel.h b/services/audioflinger/PatchPanel.h
index e31179c..a56932c 100644
--- a/services/audioflinger/PatchPanel.h
+++ b/services/audioflinger/PatchPanel.h
@@ -24,7 +24,7 @@
class Patch;
- PatchPanel(const sp<AudioFlinger>& audioFlinger);
+ explicit PatchPanel(const sp<AudioFlinger>& audioFlinger);
virtual ~PatchPanel();
/* List connected audio ports and their attributes */
@@ -54,7 +54,7 @@
class Patch {
public:
- Patch(const struct audio_patch *patch) :
+ explicit Patch(const struct audio_patch *patch) :
mAudioPatch(*patch), mHandle(AUDIO_PATCH_HANDLE_NONE),
mHalHandle(AUDIO_PATCH_HANDLE_NONE), mRecordPatchHandle(AUDIO_PATCH_HANDLE_NONE),
mPlaybackPatchHandle(AUDIO_PATCH_HANDLE_NONE) {}