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

*** ** * ** ***


```
class FakePermissionControllerOverrides
```

<br />

*** ** * ** ***

Used to override or intercept responses to emulate scenarios that `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/testing/FakePermissionController` can be overridden.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionControllerOverrides#FakePermissionControllerOverrides(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)( getGrantedPermissions: https://developer.android.com/reference/kotlin/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.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>>?, revokeAllPermissions: https://developer.android.com/reference/kotlin/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>? )` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/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.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>>?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionControllerOverrides#getGrantedPermissions()` A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |
| `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/testing/FakePermissionControllerOverrides#revokeAllPermissions()` A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionControllerOverrides#(androidx.health.connect.client.testing.stubs.Stub,androidx.health.connect.client.testing.stubs.Stub)`. |

## Public constructors

### FakePermissionControllerOverrides

```
FakePermissionControllerOverrides(
    getGrantedPermissions: Stub<Unit, Set<String>>? = null,
    revokeAllPermissions: Stub<Unit, Unit>? = null
)
```

| Parameters |
|---|---|
| `getGrantedPermissions: https://developer.android.com/reference/kotlin/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.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>>? = null` | A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionController#getGrantedPermissions()`. |
| `revokeAllPermissions: https://developer.android.com/reference/kotlin/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>? = null` | A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/FakePermissionController#revokeAllPermissions()`. |

## Public properties

### getGrantedPermissions

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

```
var getGrantedPermissions: Stub<Unit, Set<String>>?
```

A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/testing/FakePermissionController#getGrantedPermissions()` will fall back to its default behavior of returning the set of granted permissions.

### revokeAllPermissions

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

```
var revokeAllPermissions: Stub<Unit, Unit>?
```

A `https://developer.android.com/reference/kotlin/androidx/health/connect/client/testing/stubs/Stub` used to set the next responses used in `https://developer.android.com/reference/kotlin/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/kotlin/androidx/health/connect/client/testing/FakePermissionController#revokeAllPermissions()` will fall back to its default behavior of clearing the set of granted permissions.