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

*** ** * ** ***


```
public 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`:

```
<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 methods |
|---|---|
| `abstract boolean` | `isAvailable()` Determines whether the provider is supported and available on the current device. |
| `abstract void` | `onGetAgeRange( @NonNull Context context, @NonNull GetAgeRangeRequest request, CancellationSignal cancellationSignal, @NonNull Executor executor, @NonNull OutcomeReceiverCompat<@NonNull GetAgeRangeResponse, @NonNull GetAgeRangeException> callback )` Invoked when an application requests age range information. |

## Public methods

### isAvailable

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

```
abstract boolean isAvailable()
```

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)

```
abstract void onGetAgeRange(
    @NonNull Context context,
    @NonNull GetAgeRangeRequest request,
    CancellationSignal cancellationSignal,
    @NonNull Executor executor,
    @NonNull OutcomeReceiverCompat<@NonNull GetAgeRangeResponse, @NonNull GetAgeRangeException> callback
)
```

Invoked when an application requests age range information.

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