// registerListener / removeListener are the mobile plugin runtime's own // commands, the ones `addPluginListener` invokes to hear the `action` // event. They are commands like any other to the ACL: without them here the // listener was refused ("media-session.registerListener not allowed") and // the card's buttons went nowhere. // `remote_failed` is the RUST command's name, which is what the ACL keys on // (the invoke is `plugin:media-session|remote_failed`); the Kotlin side's // `remoteFailed` is reached through run_mobile_plugin and never appears here. const COMMANDS: &[&str] = &["update", "clear", "remote_failed", "registerListener", "removeListener"]; fn main() { // Registers the command permissions (permissions/autogenerated) and, on // Android, hands the Gradle module under android/ to tauri-build, which // includes it in the app project (tauri.settings.gradle). tauri_plugin::Builder::new(COMMANDS) .android_path("android") .build(); }