binder: fix performance-unnecessary-value-param
Bug: 162909698
Test: m libbinder
Change-Id: I91afd69d482984138a52dda39bc68056d62a442e
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index d4cc907..f4060a2 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -184,7 +184,6 @@
"-google-default-arguments",
"-google-explicit-constructor",
"-google-runtime-int",
- "-performance-unnecessary-value-param",
],
}
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 28ce935..c5835c6 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -1077,7 +1077,7 @@
sp<BBinder> the_context_object;
-void IPCThreadState::setTheContextObject(sp<BBinder> obj)
+void IPCThreadState::setTheContextObject(const sp<BBinder>& obj)
{
the_context_object = obj;
}
diff --git a/libs/binder/include/binder/IPCThreadState.h b/libs/binder/include/binder/IPCThreadState.h
index 418ac35..4da8aa1 100644
--- a/libs/binder/include/binder/IPCThreadState.h
+++ b/libs/binder/include/binder/IPCThreadState.h
@@ -146,7 +146,7 @@
void blockUntilThreadAvailable();
// Service manager registration
- void setTheContextObject(sp<BBinder> obj);
+ void setTheContextObject(const sp<BBinder>& obj);
// WARNING: DO NOT USE THIS API
//