# ProcessGlobalConfig

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/ProcessGlobalConfig.java+class:androidx.webkit.ProcessGlobalConfig) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

*** ** * ** ***


```
class ProcessGlobalConfig
```

<br />

*** ** * ** ***

Process Global Configuration for WebView.

WebView has some process-global configuration parameters that cannot be changed once WebView has been loaded. This class allows apps to set these parameters.

If it is used, the configuration should be set and `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)` should be called prior to loading WebView into the calling process. Most of the methods in `https://developer.android.com/reference/android/webkit/package-summary.html` and `https://developer.android.com/reference/kotlin/androidx/webkit/package-summary` packages load WebView, so the configuration should be applied before calling any of these methods.

The following code configures the data directory suffix that WebView uses and then applies the configuration. WebView uses this configuration when it is loaded.

```kotlin
ProcessGlobalConfig config = new ProcessGlobalConfig();
config.setDataDirectorySuffix("random_suffix")
ProcessGlobalConfig.apply(config);
```

`https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)` can only be called once.

Only a single thread should access this class at a given time.

The configuration should be set up as early as possible during application startup, to ensure that it happens before any other thread can call a method that loads WebView.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC() = 3` WebView's UI thread initialization will run in multiple short blocks to improve responsiveness, reducing the risk of ANRs. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS() = 3` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS() = 3` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_VERY_SHORT_TASKS() = 3` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP() = 4` This is the same as `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` in addition to stopping `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat#isMultiProcessEnabled()` check from triggering startup. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_DEFAULT() = -1` WebView's UI thread initialization may or may not block the UI thread, depending on the internal implementation. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_SYNC() = 0` WebView's UI thread initialization will run in a single, continuous block. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#ProcessGlobalConfig()()` Creates a `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` object. |

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)(config: https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig)` Applies the configuration to be used by WebView on loading. |
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setDataDirectorySuffix(android.content.Context,java.lang.String)(context: https://developer.android.com/reference/android/content/Context.html, suffix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Define the directory used to store WebView data for the current process. |
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") [setDirectoryBasePaths](https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setDirectoryBasePaths(android.content.Context,java.io.File,java.io.File))( context: https://developer.android.com/reference/android/content/Context.html, dataDirectoryBasePath: https://developer.android.com/reference/java/io/File.html, cacheDirectoryBasePath: https://developer.android.com/reference/java/io/File.html )` **This function is deprecated.** Deprecated due to the lack of usage and the added maintenance complexity. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setPartitionedCookiesEnabled(android.content.Context,boolean)(context: https://developer.android.com/reference/android/content/Context.html, isEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Configures whether partitioned cookies should be enabled or not. |
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") @https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "setUiThreadStartupModeV2(context, startupMode)") [setUiThreadStartupMode](https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupMode(android.content.Context,int))(context: https://developer.android.com/reference/android/content/Context.html, startupMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)` instead. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE_V2, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)(context: https://developer.android.com/reference/android/content/Context.html, startupMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Configures how WebView's UI thread initialization should be run. |

## Constants

### UI_THREAD_STARTUP_MODE_ASYNC

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
const val UI_THREAD_STARTUP_MODE_ASYNC = 3: Int
```

WebView's UI thread initialization will run in multiple short blocks to improve responsiveness, reducing the risk of ANRs. However, the wall time of the initialization will be longer than `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_SYNC()`.

### UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
@ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC")
const val UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS = 3: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead.

WebView's UI thread initialization will run in multiple blocks to improve responsiveness. However, some of these blocks may still be long enough to cause ANRs

### UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
@ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC")
const val UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS = 3: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead.

WebView's UI thread initialization will run in multiple short blocks to improve responsiveness, reducing the risk of ANRs compared to `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS()`.

### UI_THREAD_STARTUP_MODE_ASYNC_VERY_SHORT_TASKS

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
@ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC")
const val UI_THREAD_STARTUP_MODE_ASYNC_VERY_SHORT_TASKS = 3: Int
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead.

WebView's UI thread initialization will run in multiple very short blocks to improve app responsiveness and make ANRs unlikely compared to `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS()` or `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS()`

### UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
const val UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP = 4: Int
```

This is the same as `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` in addition to stopping `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat#isMultiProcessEnabled()` check from triggering startup. This startup mode is only supported by `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)`

### UI_THREAD_STARTUP_MODE_DEFAULT

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
const val UI_THREAD_STARTUP_MODE_DEFAULT = -1: Int
```

WebView's UI thread initialization may or may not block the UI thread, depending on the internal implementation.

### UI_THREAD_STARTUP_MODE_SYNC

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
const val UI_THREAD_STARTUP_MODE_SYNC = 0: Int
```

WebView's UI thread initialization will run in a single, continuous block. This can negatively impact responsiveness and may lead to ANRs.

## Public constructors

### ProcessGlobalConfig

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

```
ProcessGlobalConfig()
```

Creates a `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` object.

## Public functions

### apply

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

```
java-static fun apply(config: ProcessGlobalConfig): Unit
```

Applies the configuration to be used by WebView on loading.

This method can only be called once.

Calling this method will not cause WebView to be loaded and will not block the calling thread.

| Parameters |
|---|---|
| `config: https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the config to be applied |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if WebView has already been initialized in the current process or if this method was called before |

### setDataDirectorySuffix

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

```
@RequiresFeature(name = WebViewFeature.STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)")
fun setDataDirectorySuffix(context: Context, suffix: String): ProcessGlobalConfig
```

Define the directory used to store WebView data for the current process.

The provided suffix will be used when constructing data and cache directory paths. If this API is not called, no suffix will be used. Each directory can be used by only one process in the application. If more than one process in an app wishes to use WebView, only one process can use the default directory, and other processes must call this API to define a unique suffix.

This means that different processes in the same application cannot directly share WebView-related data, since the data directories must be distinct. Applications that use this API may have to explicitly pass data between processes. For example, login cookies may have to be copied from one process's cookie jar to the other using `https://developer.android.com/reference/android/webkit/CookieManager.html` if both processes' WebViews are intended to be logged in.

Most applications should simply ensure that all components of the app that rely on WebView are in the same process, to avoid needing multiple data directories. The `https://developer.android.com/reference/android/webkit/WebView.html#disableWebView()` method can be used to ensure that the other processes do not use WebView by accident in this case.

This is a compatibility method for `https://developer.android.com/reference/android/webkit/WebView.html#setDataDirectorySuffix(java.lang.String)`

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | a Context to access application assets This value cannot be null. |
| `suffix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The directory name suffix to be used for the current process. Must not contain a path separator and should not be empty. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the ProcessGlobalConfig that has the value set to allow chaining of setters |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the suffix contains a path separator or is empty. |

### setDirectoryBasePaths

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.7.0) Deprecated in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0)

```
@RequiresFeature(name = WebViewFeature.STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)")
fun [setDirectoryBasePaths](https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setDirectoryBasePaths(android.content.Context,java.io.File,java.io.File))(
    context: Context,
    dataDirectoryBasePath: File,
    cacheDirectoryBasePath: File
): ProcessGlobalConfig
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Deprecated due to the lack of usage and the added maintenance complexity. In order to support more than one process running WebView, `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setDataDirectorySuffix(android.content.Context,java.lang.String)` can be used instead to set the data directory suffix. There is no utility expected in setting the base directory base paths.

Set the base directories that WebView will use for the current process.

If this method is not used, WebView uses the default base paths defined by the Android framework.

WebView will create and use a subdirectory under each of the base paths supplied to this method.

This method can be used in conjunction with `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setDataDirectorySuffix(android.content.Context,java.lang.String)`. A different subdirectory is created for each suffix.

The base paths must be absolute paths.

The data directory must not be under the Android cache directory, as Android may delete cache files when disk space is low and WebView may not function properly if this occurs. Refer to [this](https://developer.android.com/training/data-storage/app-specific#internal-remove-cache) link.

If the specified directories already exist then they must be readable and writable by the current process. If they do not already exist, WebView will attempt to create them during initialization, along with any missing parent directories. In such a case, the directory in which WebView creates missing directories must be readable and writable by the current process.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | a Context to access application assets. This value cannot be null. |
| `dataDirectoryBasePath: https://developer.android.com/reference/java/io/File.html` | the absolute base path for the WebView data directory. |
| `cacheDirectoryBasePath: https://developer.android.com/reference/java/io/File.html` | the absolute base path for the WebView cache directory. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the ProcessGlobalConfig that has the value set to allow chaining of setters |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the paths supplied do not have the right permissions |

### setPartitionedCookiesEnabled

Added in [1.13.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.13.0)

```
@RequiresFeature(name = WebViewFeature.STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)")
fun setPartitionedCookiesEnabled(context: Context, isEnabled: Boolean): ProcessGlobalConfig
```

Configures whether partitioned cookies should be enabled or not. Refer to [this](https://github.com/privacycg/CHIPS) link for more details.

This is enabled for WebView M114 and above.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | a Context to access application assets. This value cannot be null. |
| `isEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether partitioned cookies should be enabled. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the ProcessGlobalConfig that has the value set to allow chaining of setters |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |

### setUiThreadStartupMode

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
@RequiresFeature(name = WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)")
@ReplaceWith(expression = "setUiThreadStartupModeV2(context, startupMode)")
fun [setUiThreadStartupMode](https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupMode(android.content.Context,int))(context: Context, startupMode: Int): ProcessGlobalConfig
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)` instead.

Configures how WebView's UI thread initialization should be run. See the different modes in `UI_THREAD_STARTUP_MODE_*`. Note that is API does not support `UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP` startup mode.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | a Context to access application assets. This value cannot be null. |
| `startupMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the mode to run WebView's UI thread initialization in. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the ProcessGlobalConfig that has the value set to allow chaining of setters |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |

### setUiThreadStartupModeV2

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@WebViewCompat.ExperimentalAsyncStartUp
@RequiresFeature(name = WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE_V2, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)")
fun setUiThreadStartupModeV2(context: Context, startupMode: Int): ProcessGlobalConfig
```

Configures how WebView's UI thread initialization should be run. See the different modes in `UI_THREAD_STARTUP_MODE_*`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | a Context to access application assets. This value cannot be null. |
| `startupMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the mode to run WebView's UI thread initialization in. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/ProcessGlobalConfig` | the ProcessGlobalConfig that has the value set to allow chaining of setters |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE_V2()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |