public final class CronetEngineWrapper extends Object
CronetEngine
.Modifier and Type | Class and Description |
---|---|
static interface |
CronetEngineWrapper.CronetEngineSource
Source of
CronetEngine . |
Modifier and Type | Field and Description |
---|---|
static int |
SOURCE_GMS
Cronet implementation from GMSCore.
|
static int |
SOURCE_NATIVE
Natively bundled Cronet implementation.
|
static int |
SOURCE_UNAVAILABLE
No Cronet implementation available.
|
static int |
SOURCE_UNKNOWN
Other (unknown) Cronet implementation.
|
static int |
SOURCE_USER_PROVIDED
User-provided Cronet engine.
|
Constructor and Description |
---|
CronetEngineWrapper(Context context)
Creates a wrapper for a
CronetEngine which automatically selects the most suitable
CronetProvider . |
CronetEngineWrapper(Context context,
boolean preferGMSCoreCronet)
Creates a wrapper for a
CronetEngine which automatically selects the most suitable
CronetProvider based on user preference. |
CronetEngineWrapper(org.chromium.net.CronetEngine cronetEngine)
Creates a wrapper for an existing CronetEngine.
|
Modifier and Type | Method and Description |
---|---|
int |
getCronetEngineSource()
Returns the source of the wrapped
CronetEngine . |
public static final int SOURCE_NATIVE
public static final int SOURCE_GMS
public static final int SOURCE_UNKNOWN
public static final int SOURCE_USER_PROVIDED
public static final int SOURCE_UNAVAILABLE
public CronetEngineWrapper(Context context)
CronetEngine
which automatically selects the most suitable
CronetProvider
. Sets wrapper to prefer natively bundled Cronet over GMSCore Cronet
if both are available.context
- A context.public CronetEngineWrapper(Context context, boolean preferGMSCoreCronet)
CronetEngine
which automatically selects the most suitable
CronetProvider
based on user preference.context
- A context.preferGMSCoreCronet
- Whether Cronet from GMSCore should be preferred over natively
bundled Cronet if both are available.public CronetEngineWrapper(org.chromium.net.CronetEngine cronetEngine)
cronetEngine
- An existing CronetEngine.@CronetEngineWrapper.CronetEngineSource public int getCronetEngineSource()
CronetEngine
.CronetEngineWrapper.CronetEngineSource
value.