AppFunctionPackageMetadata


public final class AppFunctionPackageMetadata


Represents metadata about a package providing app functions.

Summary

Public constructors

AppFunctionPackageMetadata(
    @NonNull String packageName,
    @NonNull List<@NonNull AppFunctionMetadata> appFunctions
)

Public methods

boolean
equals(Object other)
final @NonNull List<@NonNull AppFunctionMetadata>

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

final @NonNull String

name of the package.

int
final AppFunctionAppMetadata

Resolves and parses the AppFunctionAppMetadata for this package.

@NonNull String

Public constructors

AppFunctionPackageMetadata

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

Public methods

equals

public boolean equals(Object other)

getAppFunctions

Added in 1.0.0-alpha03
public final @NonNull List<@NonNull AppFunctionMetadatagetAppFunctions()

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

getPackageName

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

name of the package.

hashCode

public int hashCode()

resolveAppFunctionAppMetadata

Added in 1.0.0-alpha03
@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()