AttachCurrentThread should only warn on missing thread name if CheckJNI is enabled.
Bug: 17108693
Change-Id: I346cc090e091605c552e5954d7ea1ca4874cea5f
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 05003cb..ba53c43 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -900,11 +900,7 @@
bool Runtime::AttachCurrentThread(const char* thread_name, bool as_daemon, jobject thread_group,
bool create_peer) {
- bool success = Thread::Attach(thread_name, as_daemon, thread_group, create_peer) != NULL;
- if (thread_name == NULL) {
- LOG(WARNING) << *Thread::Current() << " attached without supplying a name";
- }
- return success;
+ return Thread::Attach(thread_name, as_daemon, thread_group, create_peer) != NULL;
}
void Runtime::DetachCurrentThread() {