AppFunctionPackageMetadata


class AppFunctionPackageMetadata


Represents metadata about a package providing app functions.

Summary

Public constructors

AppFunctionPackageMetadata(
    packageName: String,
    appFunctions: List<AppFunctionMetadata>
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
AppFunctionAppMetadata?

Resolves and parses the AppFunctionAppMetadata for this package.

open String

Public properties

List<AppFunctionMetadata>

list of AppFunctionMetadata for each app function provided by the app.

String

name of the package.

Public constructors

AppFunctionPackageMetadata

Added in 1.0.0-alpha03
AppFunctionPackageMetadata(
    packageName: String,
    appFunctions: List<AppFunctionMetadata>
)

Public functions

equals

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

hashCode

open fun hashCode(): Int

resolveAppFunctionAppMetadata

Added in 1.0.0-alpha03
@WorkerThread
@RequiresApi(value = 31)
fun resolveAppFunctionAppMetadata(context: Context): AppFunctionAppMetadata?

Resolves and parses the AppFunctionAppMetadata for this package.

This function parses the AppFunctionAppMetadata from the XML file specified in the AndroidManifest.xml within the <application> tag, where it is linked as a resource using a <property> tag with the name android.app.appfunctions.app_metadata.

For example, in target app's AndroidManifest this will be defined as:

<application ...>
...
<property
android:name="android.app.appfunctions.app_metadata"
android:resource="@xml/your_metadata_file" />
</application>

This method should be called on a background/worker thread as it reads resources from another app.

Parameters
context: Context

The Context used to access the resources. Any resource references in the metadata, are resolved using this context's current configuration (e.g., for localization).

Returns
AppFunctionAppMetadata?

The parsed AppFunctionAppMetadata on success, or null if the metadata is not defined, the package is not found.

toString

open fun toString(): String

Public properties

appFunctions

Added in 1.0.0-alpha03
val appFunctionsList<AppFunctionMetadata>

list of AppFunctionMetadata for each app function provided by the app.

packageName

Added in 1.0.0-alpha03
val packageNameString

name of the package.