# ProviderClearCredentialStateRequest

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/ProviderClearCredentialStateRequest.kt+class:androidx.credentials.provider.ProviderClearCredentialStateRequest) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

<br />

```
public final class ProviderClearCredentialStateRequest
```

<br />

*** ** * ** ***

Request class for clearing a user's credential state from the credential providers.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#callingAppInfo()` is null Note : Credential providers are not expected to utilize the constructor in this class for any production flow. This constructor must only be used for testing purposes. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#ProviderClearCredentialStateRequest(androidx.credentials.provider.CallingAppInfo)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo callingAppInfo )` constructs an instance of `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest request)` Helper method to convert the given `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest.Companion#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)` to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the instance needs to be sent across a process. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest` | `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#fromBundle(android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html bundle)` Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)`, back to an instance of `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo` | `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#getCallingAppInfo()()` info pertaining to the calling app that's making the request |

## Public constructors

### ProviderClearCredentialStateRequest

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

```
public ProviderClearCredentialStateRequest(
    @NonNull CallingAppInfo callingAppInfo
)
```

constructs an instance of `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/CallingAppInfo callingAppInfo` | info pertaining to the calling app that's making the request |

## Public methods

### asBundle

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

```
public static final @NonNull Bundle asBundle(@NonNull ProviderClearCredentialStateRequest request)
```

Helper method to convert the given `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest.Companion#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)` to a parcelable `https://developer.android.com/reference/android/os/Bundle.html`, in case the instance needs to be sent across a process. Consumers of this method should use `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#fromBundle(android.os.Bundle)` to reconstruct the class instance back from the bundle returned here.

### fromBundle

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

```
public static final @NonNull ProviderClearCredentialStateRequest fromBundle(@NonNull Bundle bundle)
```

Helper method to convert a `https://developer.android.com/reference/android/os/Bundle.html` retrieved through `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)`, back to an instance of `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest`.

Throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` if the conversion fails. This means that the given `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest.Companion#fromBundle(android.os.Bundle)` does not contain a `ProviderCreateCredentialRequest`. The bundle should be constructed and retrieved from `https://developer.android.com/reference/androidx/credentials/provider/ProviderClearCredentialStateRequest#asBundle(androidx.credentials.provider.ProviderClearCredentialStateRequest)` itself and never be created from scratch to avoid the failure.

### getCallingAppInfo

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

```
public final @NonNull CallingAppInfo getCallingAppInfo()
```

info pertaining to the calling app that's making the request