Fix google-explicit-constructor warnings in audioflinger, audiopolicy.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1
Change-Id: I3b73f0cd73f47be7735cc374306c02301c20588f
diff --git a/services/audioflinger/AutoPark.h b/services/audioflinger/AutoPark.h
index e539e47..9ac7b65 100644
--- a/services/audioflinger/AutoPark.h
+++ b/services/audioflinger/AutoPark.h
@@ -21,7 +21,7 @@
public:
// Park the specific FastThread, which can be nullptr, in hot idle if not currently idling
- AutoPark(const sp<T>& fastThread) : mFastThread(fastThread)
+ explicit AutoPark(const sp<T>& fastThread) : mFastThread(fastThread)
{
mPreviousCommand = FastThreadState::HOT_IDLE;
if (fastThread != nullptr) {
diff --git a/services/audioflinger/LinearMap.h b/services/audioflinger/LinearMap.h
index fca14dd..2220a0c 100644
--- a/services/audioflinger/LinearMap.h
+++ b/services/audioflinger/LinearMap.h
@@ -134,7 +134,7 @@
FIND_METHOD_START_VALUE, // No samples in history, using start value
};
- LinearMap(size_t size)
+ explicit LinearMap(size_t size)
: mSize(size),
mPos(0), // a circular buffer, so could start anywhere. the first sample is at 1.
mSamples(0),