From 901e72edc0b25069f43bc76f744d529a087bf183 Mon Sep 17 00:00:00 2001 From: Ming-Chuan Date: Mon, 15 Nov 2021 15:14:50 +0800 Subject: [PATCH] [BinderTransport] Print error message when API level is too low (#27989) Also removes an obsolete API --- .../transport/binder/client/channel_create.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/ext/transport/binder/client/channel_create.cc b/src/core/ext/transport/binder/client/channel_create.cc index 24ecf5e1fa2..0d7fb3c5f8e 100644 --- a/src/core/ext/transport/binder/client/channel_create.cc +++ b/src/core/ext/transport/binder/client/channel_create.cc @@ -28,6 +28,7 @@ #include #include +#include #ifdef GPR_SUPPORT_BINDER_TRANSPORT @@ -37,7 +38,6 @@ #include "absl/time/clock.h" #include "absl/time/time.h" -#include #include #include "src/core/ext/filters/client_channel/client_channel.h" @@ -130,14 +130,13 @@ bool InitializeBinderChannelJavaClass(void* jni_env_void) { namespace grpc { namespace experimental { -void BindToOnDeviceServerService(void*, jobject, absl::string_view, - absl::string_view) { - GPR_ASSERT(0); -} - std::shared_ptr CreateBinderChannel( void*, jobject, absl::string_view, absl::string_view, std::shared_ptr) { + gpr_log(GPR_ERROR, + "This APK is compiled with Android API level = %d, which is not " + "supported. See port_platform.h for supported versions.", + __ANDROID_API__); GPR_ASSERT(0); return {}; } @@ -146,11 +145,19 @@ std::shared_ptr CreateCustomBinderChannel( void*, jobject, absl::string_view, absl::string_view, std::shared_ptr, const ChannelArguments&) { + gpr_log(GPR_ERROR, + "This APK is compiled with Android API level = %d, which is not " + "supported. See port_platform.h for supported versions.", + __ANDROID_API__); GPR_ASSERT(0); return {}; } bool InitializeBinderChannelJavaClass(void* jni_env_void) { + gpr_log(GPR_ERROR, + "This APK is compiled with Android API level = %d, which is not " + "supported. See port_platform.h for supported versions.", + __ANDROID_API__); GPR_ASSERT(0); return {}; }