Skip to content
  • Jan-Erik Rediger's avatar
    Remove service-glean's hard-dependency on httpurlconnection · a660d340
    Jan-Erik Rediger authored
    We still test with it, so we keep it around.
    
    ️ **BREAKING CHANGE** 
    
    ️
    
    Users will need to supply a configuration with a ping uploader to Glean
    now.
    A default lib-fetch-httpurlconnection implementation can be used like
    this:
    
    ```kotlin
    import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient;
    import mozilla.components.service.glean.config.Configuration;
    import mozilla.components.service.glean.net.ConceptFetchHttpUploader;
    
    val config = Configuration(httpClient = ConceptFetchHttpUploader(lazy { HttpURLConnectionClient() }))
    Glean.initialize(context, true, config)
    ```
    
    For Java this becomes:
    
    ```java
    import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient;
    import mozilla.components.service.glean.config.Configuration;
    import mozilla.components.service.glean.net.ConceptFetchHttpUploader;
    
    ConceptFetchHttpUploader httpClient = ConceptFetchHttpUploader.fromClient(new HttpURLConnectionClient());
    Configuration config = new Configuration(httpClient);
    Glean.INSTANCE.initialize(context, true, config);
    ```
    
    Co-authored-by: default avatarAlessio Placitelli <alessio.placitelli@gmail.com>
    a660d340