Open
Description
What feature would you like to see?
CctTransportBackend.doSend()
is hardcoded to use HttpURLConnection.
Ideally this would be easily configurable to share the HTTP Client with other parts of the app, such as image loaders, APIs (retrofit).
This is possible with URL.setURLStreamHandlerFactory
to either Cronet or OkHttp (via ObsoleteUrlFactory)
While it seems possible to replace it via TransportBackendDiscovery in the manifest, it would duplicate a lot of code from CctTransportBackend.
How would you use it?
For Wear Apps, using OkHttp provides a centralised place to restrict requests when it isn't appropriate, such as avoiding using LTE and logging network traffic. OkHttp has event listeners and interceptors that allow such things.