Click actions
Every trigger and every action an element can carry, and which of them an untrusted theme may use.
On this page
clickActions is a JSON array held in a string. Each entry has a trigger, an action and a value; the value is a formula evaluated when the action fires.
"clickActions": "[{\"trigger\":\"long_press\",\"action\":\"go_to_page\",\"value\":\"settings\"}]"Triggers#
| Trigger | When |
|---|---|
tap | A single tap. |
double_tap | Two taps. |
long_press | A press and hold. |
swipe_up | An upward swipe on the element. |
swipe_down | A downward swipe on the element. |
submit | input_field only. The keyboard's enter or search key. Giving a field a submit action is what puts that key on the keyboard in the first place. |
appear | The element becomes visible. |
appear fires on the transition from hidden to visible: a hidden formula turning false, a page being opened, a card scrolling into a list. Two things it deliberately does not do:
- It does not fire on the state an element is first seen in. Opening the launcher onto a page does not replay every
appearon it, and someone whose Private Space was already open is not suddenly scrolled somewhere they did not ask to go. - It does not fire again when a scrolled-away card is rebuilt. The launcher remembers what was visible per element, outside the element, precisely so scrolling back does not re-trigger it.
Actions#
| Action | Value | What it does |
|---|---|---|
open_url | An address | Opens it. Restricted by scheme in an untrusted theme; see below. |
open_app | Package name | Launches the app. |
open_role | A role, e.g. default_phone | Launches whichever app the user chose for that job. See app roles. |
open_first_app | The id of an app_grid | Launches the app at the top of that grid, exactly as tapping it would. Meant for the submit key of a search field. Does nothing when the grid shows no app, and never fires from Appear. In an untrusted theme it works from Submit only; see below. |
app_shortcut | package:shortcut-id | Triggers an app shortcut. |
dial | A phone number | Opens the dialler with the number, without calling it. |
intent | An intent URI | For themes that need something the actions above do not cover. Heavily restricted in an untrusted theme, and never accepted in the store. |
go_to_page | Page id | Navigates, even where no cable exists. |
scroll_to | An element id | Brings the scrolling container holding that element to it. See scroll targets. |
set_variable | name=value | Writes a variable. Without =, clears it. |
open_notifications | - | Opens the system notification shade. |
launcher_settings | - | Opens the launcher's settings. |
unlock_profile / lock_profile | Profile | Unlocks or locks a work profile or Private Space, so a theme can draw its own lock button. |
private_space_settings | - | Opens the Private Space settings. |
notification_access | - | Opens the permission screen, for the prompt a theme draws behind notification_access. |
What an untrusted theme may open#
open_app launches apps of the personal profile only. open_first_app follows the same line by other means: it launches whatever an app grid shows at the top, which can be a work or Private Space app, so in an untrusted theme it only fires from Submit, the moment the reader asks for exactly that result. From a tap anywhere on the page it does nothing.
A theme that came from elsewhere is untrusted until the user says otherwise. For it, open_url accepts only these schemes:
http https mailto tel sms smsto geo marketAnything else does nothing at all. intent values lose their component, selector and flags, and their address must pass the same list.
app_shortcut does nothing in an untrusted theme. A shortcut runs as the app that published it and can open screens that app keeps to itself, and unlike an intent there is nothing in it the launcher could take away to make it safe.
From Appear, which fires without anyone touching the screen, an untrusted theme may only move its own page: set_variable, scroll_to and go_to_page. Everything that opens something, including the notification shade, needs a gesture.
Two schemes never leave the device and are always allowed as an image source: asset:// for a file inside the theme bundle and app-icon:// for an installed app's icon. They are not accepted as the target of a click action, where they would be an attempt to hand a local file to another app.
This is an allow-list rather than a list of blocked schemes on purpose. A blocked-list only ever covers what somebody thought of at the time, and there was a scheme that dialled diagnostic codes on some phones for exactly as long as nobody had thought of it.
A theme you built yourself is trusted and runs unfiltered. A theme you import that wants more than the hardening allows makes the launcher say so, name the scheme, and ask; see what review checks for what the store does with the same question.
Documentation for launcher 0.1.0-alpha Android 12 and later last updated