suppress unguarded-availability warning for only AServiceManager_waitForService
Test: build & presubmit Change-Id: I4542f3809cb49470290b9b7e3f940a8644c301c7
This commit is contained in:
parent
6bca8c1df8
commit
26b9f22b2d
2 changed files with 6 additions and 4 deletions
|
|
@ -107,10 +107,6 @@ cc_library_shared {
|
|||
"-Werror",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wthread-safety",
|
||||
|
||||
// AServiceManager_waitForService is available on only 31+, but it's still safe for Thread
|
||||
// service because it's enabled on only 34+
|
||||
"-Wno-unguarded-availability",
|
||||
],
|
||||
srcs: [
|
||||
":services.connectivity-netstats-jni-sources",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,13 @@ namespace android {
|
|||
static jobject com_android_server_ServiceManagerWrapper_waitForService(
|
||||
JNIEnv* env, jobject clazz, jstring serviceName) {
|
||||
ScopedUtfChars name(env, serviceName);
|
||||
|
||||
// AServiceManager_waitForService is available on only 31+, but it's still safe for Thread
|
||||
// service because it's enabled on only 34+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
return AIBinder_toJavaBinder(env, AServiceManager_waitForService(name.c_str()));
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue