# 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)

*** ** * ** ***


```
public 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/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/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.

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

`https://developer.android.com/reference/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 |
|---|---|
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/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. |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS() = 3` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS() = 3` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "ProcessGlobalConfig.UI_THREAD_STARTUP_MODE_ASYNC") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_VERY_SHORT_TASKS() = 3` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` instead. <br /> |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP() = 4` This is the same as `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` in addition to stopping `https://developer.android.com/reference/androidx/webkit/WebViewCompat#isMultiProcessEnabled()` check from triggering startup. |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/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. |
| `static final int` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp https://developer.android.com/reference/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/androidx/webkit/ProcessGlobalConfig#ProcessGlobalConfig()()` Creates a `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` object. |

| ### Public methods |
|---|---|
| `static void` | `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#apply(androidx.webkit.ProcessGlobalConfig)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig config)` Applies the configuration to be used by WebView on loading. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setDataDirectorySuffix(android.content.Context,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html suffix)` Define the directory used to store WebView data for the current process. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") [setDirectoryBasePaths](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setDirectoryBasePaths(android.content.Context,java.io.File,java.io.File))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/File.html dataDirectoryBasePath, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/File.html cacheDirectoryBasePath )` **This method is deprecated.** Deprecated due to the lack of usage and the added maintenance complexity. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setPartitionedCookiesEnabled(android.content.Context,boolean)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, boolean isEnabled)` Configures whether partitioned cookies should be enabled or not. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") @https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "setUiThreadStartupModeV2(context, startupMode)") [setUiThreadStartupMode](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupMode(android.content.Context,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, int startupMode)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig` | `@https://developer.android.com/reference/androidx/webkit/WebViewCompat.ExperimentalAsyncStartUp @https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.STARTUP_FEATURE_SET_UI_THREAD_STARTUP_MODE_V2, enforcement = "androidx.webkit.WebViewFeature#isStartupFeatureSupported(String, Context)") https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupModeV2(android.content.Context,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, int startupMode)` 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
public static final int 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. However, the wall time of the initialization will be longer than `https://developer.android.com/reference/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")
public static final int UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS = 3
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/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")
public static final int UI_THREAD_STARTUP_MODE_ASYNC_SHORT_TASKS = 3
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/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/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")
public static final int UI_THREAD_STARTUP_MODE_ASYNC_VERY_SHORT_TASKS = 3
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/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/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC_LONG_TASKS()` or `https://developer.android.com/reference/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
public static final int UI_THREAD_STARTUP_MODE_ASYNC_WITHOUT_MULTI_PROCESS_STARTUP = 4
```

This is the same as `https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#UI_THREAD_STARTUP_MODE_ASYNC()` in addition to stopping `https://developer.android.com/reference/androidx/webkit/WebViewCompat#isMultiProcessEnabled()` check from triggering startup. This startup mode is only supported by `https://developer.android.com/reference/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
public static final int UI_THREAD_STARTUP_MODE_DEFAULT = -1
```

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
public static final int UI_THREAD_STARTUP_MODE_SYNC = 0
```

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)

```
public ProcessGlobalConfig()
```

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

## Public methods

### apply

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

```
public static void apply(@NonNull ProcessGlobalConfig config)
```

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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig config` | 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)")
public @NonNull ProcessGlobalConfig setDataDirectorySuffix(@NonNull Context context, @NonNull String suffix)
```

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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | a Context to access application assets This value cannot be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html suffix` | The directory name suffix to be used for the current process. Must not contain a path separator and should not be empty. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/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/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/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)")
public @NonNull ProcessGlobalConfig [setDirectoryBasePaths](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setDirectoryBasePaths(android.content.Context,java.io.File,java.io.File))(
    @NonNull Context context,
    @NonNull File dataDirectoryBasePath,
    @NonNull File cacheDirectoryBasePath
)
```

> [!CAUTION]
> **This method 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/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/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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | a Context to access application assets. This value cannot be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/File.html dataDirectoryBasePath` | the absolute base path for the WebView data directory. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/File.html cacheDirectoryBasePath` | the absolute base path for the WebView cache directory. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/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/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/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)")
public @NonNull ProcessGlobalConfig setPartitionedCookiesEnabled(@NonNull Context context, boolean isEnabled)
```

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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | a Context to access application assets. This value cannot be null. |
| `boolean isEnabled` | whether partitioned cookies should be enabled. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/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/androidx/webkit/WebViewFeature#STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/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)")
public @NonNull ProcessGlobalConfig [setUiThreadStartupMode](https://developer.android.com/reference/androidx/webkit/ProcessGlobalConfig#setUiThreadStartupMode(android.content.Context,int))(@NonNull Context context, int startupMode)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | a Context to access application assets. This value cannot be null. |
| `int startupMode` | the mode to run WebView's UI thread initialization in. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/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/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/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)")
public @NonNull ProcessGlobalConfig setUiThreadStartupModeV2(@NonNull Context context, int startupMode)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | a Context to access application assets. This value cannot be null. |
| `int startupMode` | the mode to run WebView's UI thread initialization in. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/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/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/androidx/webkit/WebViewFeature#isStartupFeatureSupported(android.content.Context,java.lang.String)`. |