AppFunctionObserver
interface AppFunctionObserver
| android.app.appfunctions.AppFunctionObserver |
Interface for observing changes to app functions provided to AppFunctionManager.observeAppFunctions.
Summary
| Public methods | |
|---|---|
| abstract Unit |
onAppFunctionMetadataChanged(changedPackageNames: MutableSet<String!>)Called when changes occur to a package exposing app functions that may impact the state or metadata of its contained functions. |
| abstract Unit |
onAppFunctionStatesChanged(changedFunctionNames: MutableSet<AppFunctionName!>)Called when the runtime state of one or more app functions changes. |
Public methods
onAppFunctionMetadataChanged
abstract fun onAppFunctionMetadataChanged(changedPackageNames: MutableSet<String!>): Unit
Called when changes occur to a package exposing app functions that may impact the state or metadata of its contained functions.
This includes changes such as:
- The definition of a function metadata exposed by the package has changed (e.g, the parameters of the function have changed).
- All functions within the package are added or removed due to the package being installed or uninstalled.
- The package's
AppFunctionPackageMetadatahas been updated.
Upon receiving this notification, clients can call AppFunctionManager.searchAppFunctions with AppFunctionSearchSpec.Builder.setPackageNames to retrieve the updated AppFunctionMetadata for affected functions.
Clients should call AppFunctionManager.getAppFunctionStates to retrieve the latest AppFunctionState for packages affected by these changes.
Note: If packages are reported to have changed but are not returned from AppFunctionManager.searchAppFunctions, it means that the packages have been uninstalled or no longer have functions.
| Parameters | |
|---|---|
changedPackageNames |
MutableSet<String!>: The names of the updated packages. This value cannot be null. |
onAppFunctionStatesChanged
abstract fun onAppFunctionStatesChanged(changedFunctionNames: MutableSet<AppFunctionName!>): Unit
Called when the runtime state of one or more app functions changes.
Upon receiving this notification, clients can call AppFunctionManager.getAppFunctionStates to retrieve the updated AppFunctionState for the affected functions.
| Parameters | |
|---|---|
changedFunctionNames |
MutableSet<AppFunctionName!>: The list of AppFunctionNames for the functions whose state has changed. This value cannot be null. |