Fix/suppress surfaceflinger google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I8d88cf50fcef8a1ebeeececcb304828ab06d4788
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.h b/services/surfaceflinger/DisplayHardware/ComposerHal.h
index beee539..442006c 100644
--- a/services/surfaceflinger/DisplayHardware/ComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/ComposerHal.h
@@ -267,7 +267,7 @@
// Composer is a wrapper to IComposer, a proxy to server-side composer.
class Composer final : public Hwc2::Composer {
public:
- Composer(const std::string& serviceName);
+ explicit Composer(const std::string& serviceName);
~Composer() override;
std::vector<IComposer::Capability> getCapabilities() override;
@@ -383,7 +383,7 @@
private:
class CommandWriter : public CommandWriterBase {
public:
- CommandWriter(uint32_t initialMaxSize);
+ explicit CommandWriter(uint32_t initialMaxSize);
~CommandWriter() override;
void setLayerInfo(uint32_t type, uint32_t appId);