@UnstableApi
public final class CronetEngineWrapper


A wrapper class for a CronetEngine.

Summary

Public constructors

Creates a wrapper for a CronetEngine built using the most suitable .

Creates a wrapper for an existing CronetEngine.

CronetEngineWrapper(
    Context context,
    @Nullable String userAgent,
    boolean preferGooglePlayServices
)

Creates a wrapper for a CronetEngine built using the most suitable .

Public constructors

CronetEngineWrapper

public CronetEngineWrapper(Context context)

Creates a wrapper for a CronetEngine built using the most suitable . When natively bundled Cronet and GMSCore Cronet are both available, the natively bundled provider is preferred.

Parameters
Context context

A context.

CronetEngineWrapper

public CronetEngineWrapper(CronetEngine cronetEngine)

Creates a wrapper for an existing CronetEngine.

Parameters
CronetEngine cronetEngine

The CronetEngine to wrap.

CronetEngineWrapper

public CronetEngineWrapper(
    Context context,
    @Nullable String userAgent,
    boolean preferGooglePlayServices
)

Creates a wrapper for a CronetEngine built using the most suitable . When natively bundled Cronet and GMSCore Cronet are both available, preferGMSCoreCronet determines which is preferred.

Parameters
Context context

A context.

@Nullable String userAgent

A default user agent, or null to use a default user agent of the CronetEngine.

boolean preferGooglePlayServices

Whether Cronet from Google Play Services should be preferred over Cronet Embedded, if both are available.