AttachCurrentThread should only warn on missing thread name if CheckJNI is enabled.
Bug: 17108693
Change-Id: I346cc090e091605c552e5954d7ea1ca4874cea5f
diff --git a/runtime/thread.cc b/runtime/thread.cc
index c7cd57d..dcc897f 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -403,6 +403,8 @@
if (thread_name != nullptr) {
self->tlsPtr_.name->assign(thread_name);
::art::SetThreadName(thread_name);
+ } else if (self->GetJniEnv()->check_jni) {
+ LOG(WARNING) << *Thread::Current() << " attached without supplying a name";
}
}