# AppFunctionState

Artifact: [androidx.appfunctions:appfunctions](https://developer.android.com/jetpack/androidx/releases/appfunctions) [View Source](https://cs.android.com/search?q=file:androidx/appfunctions/AppFunctionState.kt+class:androidx.appfunctions.AppFunctionState) Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

*** ** * ** ***


```
class AppFunctionState
```

<br />

*** ** * ** ***

Runtime state of an app function.

This holds properties of an app function that can change at runtime during the app's operation, such as whether the function is enabled.

This is distinct from `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata`, which represents the metadata that remains constant until the providing package is updated. While `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata` defines what a function is, the `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState` defines its current operational status.

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/util/ArraySet.html<https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html>?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#activityIds()` The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html`s this app function is associated with. |
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionName` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#functionName()` The `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionName` associated with this state. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionState#isEnabled()` Whether this app function can be executed. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### activityIds

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val activityIds: ArraySet<AppFunctionActivityId>?
```

The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html`s this app function is associated with.

This will only be non-null when `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#scope()` equals to `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`. See `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()` for more details.

### functionName

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val functionName: AppFunctionName
```

The `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionName` associated with this state.

### isEnabled

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val isEnabled: Boolean
```

Whether this app function can be executed.

This can be false if:

- The app disabled the function with `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionManager#setAppFunctionEnabled(kotlin.String,kotlin.Int)`.

- The function is disabled by default using `https://developer.android.com/reference/android/app/appfunctions/AppFunctionMetadata.html#PROPERTY_ENABLED_BY_DEFAULT` and was never enabled.

- A function without an associated `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionService` has not been registered using `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionManager#registerAppFunction(kotlin.String,java.util.concurrent.Executor,androidx.appfunctions.AppFunction)` or has been unregistered.

- The process registering the function using `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionManager#registerAppFunction(kotlin.String,java.util.concurrent.Executor,androidx.appfunctions.AppFunction)` is frozen, or the `https://developer.android.com/reference/android/content/Context.html` used to register it has been destroyed.