Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android: Use Provider to construct OkHttpChannelBuilder
Doing any reflection on OkHttpChannelBuilder requires that all methods can have their arguments resolved. We'd like to make okhttp an optional dependency (to support okhttp 2 and 3/4 simultaneously). But making okhttp optional means we can no longer construct OkHttpChannelBuilder reflectively. We swap to the Provider that doesn't have this problem. See grpc#8971. Note that ManagedChannelProvider itself only exposes its methods as protected, so they wouldn't be accessible. However OkHttpChannelProvider has its methods public. It is an open question of whether ManagedChannelProvider's methods should become public, but in any case we can hide a public OkHttpChannelProvider inside a package-private class so it is only accessable via reflection. So this code assuming public methods doesn't prevent future implementation hiding.
- Loading branch information