Fix google-explicit-constructor warnings in inputflinger.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1
Change-Id: I8259317db74b177b6e62a0aa2ad21aead47f698e
diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h
index 076f3d6..8e2fe95 100644
--- a/services/inputflinger/InputReader.h
+++ b/services/inputflinger/InputReader.h
@@ -484,7 +484,7 @@
InputReader* mReader;
public:
- ContextImpl(InputReader* reader);
+ explicit ContextImpl(InputReader* reader);
virtual void updateGlobalMetaState();
virtual int32_t getGlobalMetaState();
@@ -568,7 +568,7 @@
/* Reads raw events from the event hub and processes them, endlessly. */
class InputReaderThread : public Thread {
public:
- InputReaderThread(const sp<InputReaderInterface>& reader);
+ explicit InputReaderThread(const sp<InputReaderInterface>& reader);
virtual ~InputReaderThread();
private:
@@ -1007,7 +1007,7 @@
*/
class InputMapper {
public:
- InputMapper(InputDevice* device);
+ explicit InputMapper(InputDevice* device);
virtual ~InputMapper();
inline InputDevice* getDevice() { return mDevice; }
@@ -1058,7 +1058,7 @@
class SwitchInputMapper : public InputMapper {
public:
- SwitchInputMapper(InputDevice* device);
+ explicit SwitchInputMapper(InputDevice* device);
virtual ~SwitchInputMapper();
virtual uint32_t getSources();
@@ -1078,7 +1078,7 @@
class VibratorInputMapper : public InputMapper {
public:
- VibratorInputMapper(InputDevice* device);
+ explicit VibratorInputMapper(InputDevice* device);
virtual ~VibratorInputMapper();
virtual uint32_t getSources();
@@ -1178,7 +1178,7 @@
class CursorInputMapper : public InputMapper {
public:
- CursorInputMapper(InputDevice* device);
+ explicit CursorInputMapper(InputDevice* device);
virtual ~CursorInputMapper();
virtual uint32_t getSources();
@@ -1243,7 +1243,7 @@
class RotaryEncoderInputMapper : public InputMapper {
public:
- RotaryEncoderInputMapper(InputDevice* device);
+ explicit RotaryEncoderInputMapper(InputDevice* device);
virtual ~RotaryEncoderInputMapper();
virtual uint32_t getSources();
@@ -1264,7 +1264,7 @@
class TouchInputMapper : public InputMapper {
public:
- TouchInputMapper(InputDevice* device);
+ explicit TouchInputMapper(InputDevice* device);
virtual ~TouchInputMapper();
virtual uint32_t getSources();
@@ -1887,7 +1887,7 @@
class SingleTouchInputMapper : public TouchInputMapper {
public:
- SingleTouchInputMapper(InputDevice* device);
+ explicit SingleTouchInputMapper(InputDevice* device);
virtual ~SingleTouchInputMapper();
virtual void reset(nsecs_t when);
@@ -1905,7 +1905,7 @@
class MultiTouchInputMapper : public TouchInputMapper {
public:
- MultiTouchInputMapper(InputDevice* device);
+ explicit MultiTouchInputMapper(InputDevice* device);
virtual ~MultiTouchInputMapper();
virtual void reset(nsecs_t when);
@@ -1926,7 +1926,7 @@
class ExternalStylusInputMapper : public InputMapper {
public:
- ExternalStylusInputMapper(InputDevice* device);
+ explicit ExternalStylusInputMapper(InputDevice* device);
virtual ~ExternalStylusInputMapper() = default;
virtual uint32_t getSources();
@@ -1948,7 +1948,7 @@
class JoystickInputMapper : public InputMapper {
public:
- JoystickInputMapper(InputDevice* device);
+ explicit JoystickInputMapper(InputDevice* device);
virtual ~JoystickInputMapper();
virtual uint32_t getSources();