GrantPermissionTool

pm grant <pkg> <perm> — grant a runtime permission to an app without the user prompt. Idempotent. The permission must be one the app declared in its manifest. Treated as failure if the command exits non-zero or writes to stderr (not declared / not a runtime permission / etc.).

Privilege: requires a working ShellBackend.

Params: package_name (required), permission (required, fully-qualified).

On success the result map carries success (true), package_name, and permission.

Constructors

Link copied to clipboard
constructor(shell: ShellBackend)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult