# FakePermissionControllerOverrides

Artifact: [androidx.health.connect:connect-testing](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/testing/FakePermissionControllerOverrides.kt+class:androidx.health.connect.client.testing.FakePermissionControllerOverrides) Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/health-connect#1.0.0-alpha04)

*** ** * ** ***


```
public final class FakePermissionControllerOverrides
```

<br />

*** ** * ** ***

Used to override or intercept responses to emulate scenarios that `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController` doesn't support directly, such as throwing an exception or applying custom logic to the responses.

Every call in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController` can be overridden.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#FakePermissionControllerOverrides(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)( https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>> getGrantedPermissions, https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> revokeAllPermissions )` |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#getGetGrantedPermissions()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#getRevokeAllPermissions()()` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#setGetGrantedPermissions(androidx.health.connect.client.testing.stubs.Stub)(https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>> value)` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `final void` | `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#setRevokeAllPermissions(androidx.health.connect.client.testing.stubs.Stub)(https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> value)` A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |

## Public constructors

### FakePermissionControllerOverrides

```
public FakePermissionControllerOverrides(
    Stub<Unit, @NonNull Set<@NonNull String>> getGrantedPermissions,
    Stub<Unit, Unit> revokeAllPermissions
)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>> getGrantedPermissions` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#getGrantedPermissions()`. |
| `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> revokeAllPermissions` | A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#revokeAllPermissions()`. |

## Public methods

### getGetGrantedPermissions

Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/health-connect#1.0.0-alpha04)

```
public final Stub<Unit, @NonNull Set<@NonNull String>> getGetGrantedPermissions()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

Once all stubbed responses are consumed (or if the stub is `null`), `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#getGrantedPermissions()` will fall back to its default behavior of returning the set of granted permissions.

### getRevokeAllPermissions

Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/health-connect#1.0.0-alpha04)

```
public final Stub<Unit, Unit> getRevokeAllPermissions()
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

Once all stubbed responses are consumed (or if the stub is `null`), `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#revokeAllPermissions()` will fall back to its default behavior of clearing the set of granted permissions.

### setGetGrantedPermissions

```
public final void setGetGrantedPermissions(Stub<Unit, @NonNull Set<@NonNull String>> value)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

Once all stubbed responses are consumed (or if the stub is `null`), `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#getGrantedPermissions()` will fall back to its default behavior of returning the set of granted permissions.

### setRevokeAllPermissions

```
public final void setRevokeAllPermissions(Stub<Unit, Unit> value)
```

A `https://developer.android.com/reference/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`.

Once all stubbed responses are consumed (or if the stub is `null`), `https://developer.android.com/reference/androidx/health/connect/client/testing/FakePermissionController#revokeAllPermissions()` will fall back to its default behavior of clearing the set of granted permissions.