AppFunctionUriGrant


@AppFunctionSerializable
public final class AppFunctionUriGrant


Represents a Uri for which temporary access permission is to be granted to the caller of an AppFunction execution.

This class encapsulates a uri along with the specific access modeFlags (e.g., FLAG_GRANT_READ_URI_PERMISSION) that define the type of temporary access to be granted for that URI. However, FLAG_GRANT_PERSISTABLE_URI_PERMISSION is not allowed as only temporary access can be granted.

Using this class in the ExecuteAppFunctionResponse.Success.returnValue is equivalent to calling Context.grantUriPermission for the agent that is executing the function.

To succeed, the content provider owning the Uri must have set the grantUriPermissions attribute in its manifest or included the <grant-uri-permissions> tag.

Summary

Public constructors

AppFunctionUriGrant(@NonNull Uri uri, int modeFlags)

Public methods

boolean
equals(Object other)
final int

The access mode flags.

final @NonNull Uri

The Uri to be granted.

int
@NonNull String

Public constructors

AppFunctionUriGrant

Added in 1.0.0-alpha03
public AppFunctionUriGrant(@NonNull Uri uri, int modeFlags)

Public methods

equals

public boolean equals(Object other)

getModeFlags

Added in 1.0.0-alpha03
public final int getModeFlags()

The access mode flags.

This value must include at least one of FLAG_GRANT_READ_URI_PERMISSION or FLAG_GRANT_WRITE_URI_PERMISSION. It may optionally also include FLAG_GRANT_PREFIX_URI_PERMISSION.

getUri

Added in 1.0.0-alpha03
public final @NonNull Uri getUri()

The Uri to be granted.

hashCode

public int hashCode()

toString

public @NonNull String toString()