> Documentation index: https://developer.android.com/reference/llms.txt

# AgeSignalProvider

Artifact: [androidx.credentials.agesignals:agesignals](https://developer.android.com/jetpack/androidx/releases/credentials-agesignals.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/credentials/agesignals/AgeSignalProvider.kt+class:androidx.credentials.agesignals.AgeSignalProvider) Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/credentials-agesignals.md.txt#1.0.0-alpha01)

*** ** * ** ***


```
interface AgeSignalProvider
```

<br />

*** ** * ** ***

Provider interface to be implemented by age signal providers that will fulfill `AgeSignalManager` requests.

Implementations **must** provide a public constructor that accepts a single `Context` parameter.

Providers are discovered via metadata declared inside a `<service>` in `AndroidManifest.xml`:

```kotlin
<service
    android:name=".MyAgeSignalProviderService"
    android:exported="false">
    <meta-data
        android:name="androidx.credentials.agesignals.AGE_SIGNAL_PROVIDER_KEY"
        android:value="com.example.provider.MyAgeSignalProvider" />
</service>
```

## Summary

| ### Public functions |
|---|---|
| `Boolean` | `isAvailable()` Determines whether the provider is supported and available on the current device. |
| `Unit` | `onGetAgeRange( context: Context, request: GetAgeRangeRequest, cancellationSignal: CancellationSignal?, executor: Executor, callback: OutcomeReceiverCompat<GetAgeRangeResponse, GetAgeRangeException> )` Invoked when an application requests age range information. |

## Public functions

### isAvailable

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/credentials-agesignals.md.txt#1.0.0-alpha01)

```
fun isAvailable(): Boolean
```

Determines whether the provider is supported and available on the current device.

| Returns |
|---|---|
| `Boolean` | `true` if this provider can fulfill requests on this device; `false` otherwise |

### onGetAgeRange

Added in [1.0.0-alpha01](https://developer.android.com/jetpack/androidx/releases/credentials-agesignals.md.txt#1.0.0-alpha01)

```
fun onGetAgeRange(
    context: Context,
    request: GetAgeRangeRequest,
    cancellationSignal: CancellationSignal?,
    executor: Executor,
    callback: OutcomeReceiverCompat<GetAgeRangeResponse, GetAgeRangeException>
): Unit
```

Invoked when an application requests age range information.

| Parameters |
|---|---|
| `context: Context` | the client calling context used to launch any interactive UI (e.g. user consent or parental verification dialogs) |
| `request: GetAgeRangeRequest` | the request for getting the user's age range |
| `cancellationSignal: CancellationSignal?` | an optional signal allowing the caller to cancel the in-flight operation |
| `executor: Executor` | the executor on which the `callback` must be invoked |
| `callback: OutcomeReceiverCompat<GetAgeRangeResponse, GetAgeRangeException>` | the callback invoked upon successful retrieval or failure |