Fix/suppress binder google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters
* Remove redundant explicit of copy constructors
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: If74d738496c5787c0ec68ff808801c7ff44cf03f
diff --git a/libs/binder/ndk/ibinder_internal.h b/libs/binder/ndk/ibinder_internal.h
index ac592ea..7852298 100644
--- a/libs/binder/ndk/ibinder_internal.h
+++ b/libs/binder/ndk/ibinder_internal.h
@@ -34,7 +34,7 @@
struct ABpBinder;
struct AIBinder : public virtual ::android::RefBase {
- AIBinder(const AIBinder_Class* clazz);
+ explicit AIBinder(const AIBinder_Class* clazz);
virtual ~AIBinder();
bool associateClass(const AIBinder_Class* clazz);
@@ -97,7 +97,7 @@
ABpBinder* asABpBinder() override { return this; }
private:
- ABpBinder(const ::android::sp<::android::IBinder>& binder);
+ explicit ABpBinder(const ::android::sp<::android::IBinder>& binder);
};
struct AIBinder_Class {
@@ -141,7 +141,7 @@
const AIBinder_DeathRecipient_onBinderDied& mOnDied;
};
- AIBinder_DeathRecipient(AIBinder_DeathRecipient_onBinderDied onDied);
+ explicit AIBinder_DeathRecipient(AIBinder_DeathRecipient_onBinderDied onDied);
binder_status_t linkToDeath(AIBinder* binder, void* cookie);
binder_status_t unlinkToDeath(AIBinder* binder, void* cookie);