AppFunctionPackageMetadata


public final class AppFunctionPackageMetadata


Contains metadata about a package providing app functions.

Summary

Public constructors

Public methods

boolean
equals(Object other)
final @NonNull AppFunctionComponentsMetadata

Reusable components that could be shared within the package's functions' specifications.

final @NonNull String

The name of the package providing app functions.

int
final AppFunctionAppMetadata

Resolves and parses the AppFunctionAppMetadata for this package.

@NonNull String

Public constructors

AppFunctionPackageMetadata

Added in 1.0.0-alpha12
public AppFunctionPackageMetadata(
    @NonNull String packageName,
    @NonNull AppFunctionComponentsMetadata components
)

Public methods

equals

public boolean equals(Object other)

getComponents

Added in 1.0.0-alpha12
public final @NonNull AppFunctionComponentsMetadata getComponents()

Reusable components that could be shared within the package's functions' specifications.

getPackageName

Added in 1.0.0-alpha12
public final @NonNull String getPackageName()

The name of the package providing app functions.

hashCode

public int hashCode()

resolveAppFunctionAppMetadata

Added in 1.0.0-alpha12
@WorkerThread
@RequiresApi(value = 31)
public final AppFunctionAppMetadata resolveAppFunctionAppMetadata(@NonNull Context context)

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
@NonNull 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

public @NonNull String toString()