Merge "suppress unguarded-availability warning for only AServiceManager_waitForService" into main
This commit is contained in:
commit
eb08e8cdc8
2 changed files with 6 additions and 4 deletions
|
|
@ -107,10 +107,6 @@ cc_library_shared {
|
||||||
"-Werror",
|
"-Werror",
|
||||||
"-Wno-unused-parameter",
|
"-Wno-unused-parameter",
|
||||||
"-Wthread-safety",
|
"-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: [
|
srcs: [
|
||||||
":services.connectivity-netstats-jni-sources",
|
":services.connectivity-netstats-jni-sources",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,13 @@ namespace android {
|
||||||
static jobject com_android_server_ServiceManagerWrapper_waitForService(
|
static jobject com_android_server_ServiceManagerWrapper_waitForService(
|
||||||
JNIEnv* env, jobject clazz, jstring serviceName) {
|
JNIEnv* env, jobject clazz, jstring serviceName) {
|
||||||
ScopedUtfChars name(env, 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()));
|
return AIBinder_toJavaBinder(env, AServiceManager_waitForService(name.c_str()));
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue