# Platform Actions

Custom Intents Platform Actions are specialized actions that are specific to the BlueFletch Launcher and can be used in addition to standard Android intents.

## Supported Actions

The following is a complete list of the Platform Actions supported by Launcher with configuration examples.

* Delay
* Clear Cache
* Enable/Disable Package
* Delete Files
* Mute/Unmute/Adjust Audio
* Applying Platform XML
* Login
* Rotate Launcher to Portrait/Landscape Mode
* Clear Storage
* Set Language
* Set Timezone

### Delay

This is a unique Platform action. It is custom to BlueFletch Launcher, but it uses the typeIntent **d**.

To delay executing further intents for a set period of time, use a delay intent, with the time to delay set as "data" in milliseconds.

```json
{
    "typeIntent": "d",
    "data": "5000"
}
```

### Clear Cache

An action value of **CLEARCACHE** will cause Launcher to invoke the Platform Clear Cache on the specified package.

```json
{
    "action": "CLEARCACHE",
    "package": "com.android.chrome",
    "typeIntent": "p"
}
```

### Enable a Package

An action value of **ENABLE** will cause the specified package to be enabled.

```json
{
    "action": "ENABLE",
    "typeIntent": "p",
    "package" : "com.some.package"
}
```

### Disable a Package <a href="#disable-a-package" id="disable-a-package"></a>

An action value of **DISABLE** will cause the specified package to be disabled.

```json
{
    "action": "DISABLE",
    "typeIntent": "p",
    "package" : "com.some.package"
}
```

### Delete Files <a href="#delete-files" id="delete-files"></a>

An action value of **DELETE\_FILES** will delete the file(s) at the specified path as specified in the "data" field. This action does support the wildcard operator \* which allows for multiple files to be deleted.

```json
{
    "action": "DELETE_FILES",
    "typeIntent": "p",
    "data": "/sdcard/Download/*.pdf"
}
```

Delete File action now supports patterns of files to remove and removing only "old" files.

#### Pattern

Using the `pattern` setting within the action "extras", certain files can be deleted from a directory. &#x20;

In the following example, the delete file action will only remove PNG and PDF files.

```
{
    "action": "DELETE_FILES",
    "typeIntent": "p",
    "data": "/sdcard/Download"
    "extras": {
        "pattern": "*.png|*.pdf"
    }
}
```

#### Older Than Days

Using the `olderThanDays` setting within the action "extras", files that are older than a certain day range can be removed.

In the following example, the delete file action will only remove PNG and PDF files that have not been updated for over 5 days.

```
{
    "action": "DELETE_FILES",
    "typeIntent": "p",
    "data": "/sdcard/Download"
    "extras": {
        "pattern": "*.png|*.pdf",
        "olderThanDays": 5
    }
}
```

#### Recurse Directories

Using the `recurseDirectories` setting within the action "extras", the delete files action can recurse through sub directories, removing specified files.  `recurseDirectories` is false by default.

&#x20;In the following example, the delete file action will only remove PNG and PDF files that have not been updated for over 5 days, and the action will recurse through sub directories.

```
{
    "action": "DELETE_FILES",
    "typeIntent": "p",
    "data": "/sdcard/Download"
    "extras": {
        "pattern": "*.png|*.pdf",
        "olderThanDays": 5,
        "recurseDirectories": true
    }
}
```

### Mute Audio <a href="#mute-audio" id="mute-audio"></a>

An action value of **MUTE\_AUDIO** will cause the audio on a device to be muted. This does not affect 'Alarm' audio.&#x20;

```json
{
    "action": "MUTE_AUDIO",
    "typeIntent": "p"
}
```

### Unmute Audio <a href="#unmute-audio" id="unmute-audio"></a>

An action value of **UNMUTE\_AUDIO** will cause the audio on a device to be unmuted. This does not affect 'Alarm' audio.

```json
{
    "action": "UNMUTE_AUDIO",
    "typeIntent": "p"
}
```

### Adjust Audio <a href="#adjust-audio" id="adjust-audio"></a>

An action value of **ADJUST\_AUDIO** will cause the audio on a device to be changed and allows for specifying the percentage of max audio per type of audio. The individual audio stream to affect should be specified within the "extras" section.

Valid "extras":

* **notification:** Affects the volume of audio streams for notification sounds.
* **music:** Affects the volume of audio streams for music playback.
* **ring:** Affects the volume of audio streams for the phone ring.
* **system:** Affects the volume of audio streams for system sounds.
* **dtm:** Affects the volume of audio streams for DTMF Tones.
* **call:** Affects the volume of audio streams for phone calls.
* **alarm:** Affects identify the volume of audio streams for alarms.
* **others:** A special override that when used, can affect any audio stream not specified within the extras.

```json
{
    "action": "ADJUST_AUDIO",
    "typeIntent": "p",
    "extras" : {
        "notification": 90,
        "alarm": 100,
        "others": 50
    }
}
```

### Applying Platform XML <a href="#applying-platform-xml" id="applying-platform-xml"></a>

The action **XML** allows for invoking platform-specific XML (currently supports the Zebra platform's StageNow™ XML tooling). Use the "data" field to specify the XML file location, either located on the device sdcard or managed within Launcher assets.

This example is retrieving the XML file from the /sdcard/... local file path:

```json
{
    "action": "XML",
    "typeIntent": "p",
    "data": "/sdcard/Download/ems/gloveInput.xml"
}
```

This example is using the Assets Manager to download/manage the XML file:

```json
{
    "action": "XML",
    "typeIntent": "p",
    "data": "assets:stylusInput"
}
```

### Login

Using an action value of **LOGIN** allows for controlling when Launcher starts the device login flow.

```json
{
    "action": "LOGIN",
    "typeIntent": "p"
}
```

{% hint style="info" %}
Available in Launcher 3.7.7
{% endhint %}

### Rotate Launcher to Portrait Mode <a href="#applying-platform-xml" id="applying-platform-xml"></a>

An action value of **com.bluefletch.launcher.ACTION\_ROTATE\_PORTRAIT** will force rotation of the Launcher Home screen to portrait mode.

```json
{
    "action": "com.bluefletch.launcher.ACTION_ROTATE_PORTRAIT",
    "typeIntent": "p"
}
```

{% hint style="info" %}
Available in Launcher 3.21.17.
{% endhint %}

### Rotate Launcher to Landscape Mode <a href="#applying-platform-xml" id="applying-platform-xml"></a>

An action value of **com.bluefletch.launcher.ACTION\_ROTATE\_LANDSCAPE** will force rotation of the Launcher Home screen to landscape mode.

```json
{
    "action": "com.bluefletch.launcher.ACTION_ROTATE_LANDSCAPE",
    "typeIntent": "p"
}
```

{% hint style="info" %}
Available in Launcher 3.21.17.
{% endhint %}

### Clear Storage

An action value of **CLEAR\_STORAGE** will clear all cache and user data to which the OEM's SDK has access. Applying via the `logout` or `postLogout` array will usually (dependent on the app vendor) clear all user data for that app from the prior session.

```json
{
    "action": "CLEAR_STORAGE",
    "package": "com.example.package",
    "typeIntent": "p"
}
```

{% hint style="info" %}
Available in Launcher 3.24.20.
{% endhint %}

### Set Language

An action value of **SET\_LANGUAGE** will set the device's language based on the locale associated with a store/site location through the extra string `"lang"`.

```json
{
    "action": "SET_LANGUAGE",
    "typeIntent": "p",
    "extras": {
      "lang": "${config.ex.lang}"
    }
}
```

The extra `"lang"` can point to a [replacement variable](/bluefletch-enterprise/product-guides/bluefletch-launcher/configurable-layouts/replacement-values.md). In the example above, `"lang"` points to `"${config.ex.lang}"` - that is, to an extended attribute in the launcher.json configuration file named "lang". This extended attribute can be associated with each site by adding a column "lang" to the sitelist.csv file for a Zebra-supported locale (e.g. "en\_US", "fr\_CA", "de\_DE", "zh\_CN").

```csv
siteId,siteName,longitude,latitude,lang
1001,Atlanta,-84.38675200862285,33.75690491404407,en_US
...
```

{% hint style="info" %}
Available in Launcher 3.25.15. Only supported on Zebra devices.
{% endhint %}

### Set Timezone

An action value of **SET\_TIMEZONE** will set the device's language based on the locale associated with a store/site location through the extra string `"timezone"`.

```json
{
    "action": "SET_TIMEZONE",
    "typeIntent": "p",
    "extras": {
      "timezone": "${config.ex.timezone}",
      "ntpServer": "north-america.pool.ntp.org"
    }
 }
```

The extra "timezone" can point to a [replacement variable](/bluefletch-enterprise/product-guides/bluefletch-launcher/configurable-layouts/replacement-values.md). In the example above, "timezone" points to `"${config.ex.timezone}"` - that is, to an extended attribute in the launcher.json configuration file named "timezone". This extended attribute can be associated with each site by adding a column "lang" to the sitelist.csv file for a Zebra-supported timezone (e.g. GMT-5 or GMT-05:00, GMT+9 or GMT+09:00).

The extra `"ntpServer"` indicates a specific NTP server to use when setting the timezone.

```
siteId,siteName,longitude,latitude,timezone
1001,Atlanta,-84.38675200862285,33.75690491404407,GMT-05:00
2002,Tokyo,139.7558762393648,35.68204282600092,GMT+9
...
```

{% hint style="info" %}
Available in Launcher 3.25.15. Only supported on Zebra devices.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/custom-intents/custom-intents-platform-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
