Microsoft Intune
Android

Configure local actions for Android devices in Microsoft Intune - Microsoft Intune | Microsoft Learn

In brief

Intune now documents configuring local actions that respond to events such as device reboots, Managed Home Screen sign-ins, and power-connection changes. Actions can launch apps, send broadcasts, sign out users, or exit kiosk mode.

What Intune admins need to know

Admins can create a Local actions profile for dedicated or fully managed Android Enterprise devices. Activity actions require Overlay Permission granted through OEMConfig.

This summary was assembled from the tracked documentation change. Verify important details in the full Microsoft Learn article.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

new file mode 100644

layout: Conceptual title: Configure local actions for Android devices in Microsoft Intune - Microsoft Intune | Microsoft Learn canonicalUrl: https://learn.microsoft.com/en-us/intune/device-configuration/templates/configure-local-actions-android author: abigail-stein2 ms.author: abigailstein breadcrumb_path: /intune/breadcrumb/toc.json uhfHeaderId: MSDocsHeader-Intune feedback_system: Standard ms.service: microsoft-intune ms.collection:


Configure local actions for Android devices in Microsoft Intune - Microsoft Intune | Microsoft Learn

Android local actions let you configure actions that run directly on managed Android devices when supported device events occur. By pairing triggers with actions, you can make devices respond to events such as a device reboot, a Managed Home Screen sign-in, or a change in the device's power connection.

You can use local actions to launch apps, send broadcasts to apps, initiate a global sign-out, or exit Managed Home Screen from kiosk mode.

Prerequisites

  • An Android device enrolled as a dedicated device or fully managed device.
  • For activity actions, Overlay Permission (SYSTEM_ALERT_WINDOW) granted before you deploy the policy. For more information, see Overlay permission for foreground app launches.

Create the profile

To configure local actions, create a device configuration profile using the Local actions template.

  1. Sign in to the Microsoft Intune admin center.

  2. Select Devices > Manage devices > Configuration > Create > New policy.

  3. Select the following properties:

    • Platform: Select Android Enterprise.
    • Profile type: Select Templates.
    • Template name: Select Local actions.
  4. Select Create.

  5. In Basics, enter the following properties:

    • Name: Enter a descriptive name for the policy.
    • Description: Enter a description for the policy. This setting is optional but recommended.
    • Profile type: Select Corporate owned devices.
  6. Select Next.

  7. In Configuration settings, select Enter JSON data.

  8. Paste the completed local actions JSON. Use the settings tables, schema, and examples in this article to build the JSON.

  9. Select Next.

  10. In Scope tags (optional), assign a scope tag to filter the policy to specific IT groups. Select Next.

  11. In Assignments, select the device groups that should receive the policy. Select Next.

  12. In Review + create, review the settings. Select Create to save and assign the policy.

Note

Local actions are only supported on an Android device enrolled as a dedicated device or fully managed device.

Overlay permission for foreground app launches

Activity actions require Overlay Permission (SYSTEM_ALERT_WINDOW). Without it, foreground app launches might fail silently or behave unexpectedly.

Use OEMConfig to grant Overlay Permission to the Microsoft Intune app package, com.microsoft.intune. If Managed Home Screen is installed, also grant the permission to the Managed Home Screen package, com.microsoft.launcher.enterprise.

For Samsung, Zebra, Legacy Zebra, and Honeywell devices, see Configure permissions for Managed Home Screen on Android Enterprise devices for OEMConfig instructions.

For other OEMs, use the OEM's instructions to grant Overlay Permission through OEMConfig. If the OEM doesn't support granting the permission through OEMConfig, grant it manually in the device Settings app.

Trigger settings

A trigger defines the device event that causes one or more local actions to run.

Supported triggers

Each trigger represents an event that occurs on the device. A configuration can contain multiple trigger-and-action bundles.

TriggerValueWhen it fires
Device rebootdevice_rebootAfter the device completes a reboot and the Intune app is ready.
Managed Home Screen sign-inmhs_sign_inWhen a user signs in through Managed Home Screen.
Global sign-outglobal_sign_outWhen global sign-out starts on the device.
Device plugged indevice_plugged_inWhen the device connects to a power source, such as a charger or dock.
Device unpluggeddevice_unpluggedWhen the device disconnects from a power source.
SchedulescheduleOn the configured day and time.

Note

The plug-in and unplug triggers are intended for use with Managed Home Screen because they require an actively running app to detect the change. To use these triggers without Managed Home Screen, make sure the Microsoft Intune app is running.

Schedule trigger properties

If you use the schedule trigger, configure both schedule properties.

PropertyValue
schedule_daysA comma-separated list of day names.
schedule_timeThe time in 24-hour HH:mm format.

Note

Day names aren't case-sensitive. For schedule_time, only :00 and :30 minute values are supported. The schedule trigger has 30-minute precision and might run a few minutes after the configured time.

Action settings

An action defines what the device does when its associated trigger fires.

Supported action types

Action typeValueUse
ActivityactivityLaunch an activity in an app through an intent.
BroadcastbroadcastSend a broadcast intent to an app.
Direct APIdirect_apiRun a supported Intune device action directly.

Direct API actions

For a direct API action, use one of the following action values.

ActionValue
Initiate global sign-out from Managed Home Screenmhs_sign_out
Exit Managed Home Screen from kiosk modeexit_mhs_from_kiosk_mode

Activity and broadcast action properties

Configure the properties that apply to the action type.

KeyTypeRequiredDescription
action_typevalueStringYesThe action type: activity, broadcast, or direct_api.
packagevalueStringYes for activity and broadcast intentsThe target app package name.
classvalueStringNoThe fully qualified class name of the target component.
actionvalueStringRequired for direct API actions; optional for intentsThe intent action or supported direct API action to run.
data_urivalueStringNoA URI for the intent data.
mime_typevalueStringNoThe MIME type that describes the data format.
flagsvalueStringNoA comma-separated list of supported Android intent flags.
extrasvalueBundleArrayNoKey-value pairs that contain additional data for the receiving app.

Extra values

If the receiving app requires extras, add each extra to the extras array.

KeyTypeRequiredDescription
extra_keyvalueStringYesThe key name for the extra.
extra_valuevalueStringYesThe value for the extra.
extra_typevalueStringNoThe data type. Supported values are string, boolean, integer, long, float, and double. The default is string.

Note

Activity and broadcast actions require an explicit target package. The target app must be installed on the device. Implicit intents are blocked, and an action fails silently if its target package isn't installed.

Note

The data_uri property supports the geo, http, https, mailto, and tel URI schemes. The flags property supports FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_CLEAR_TOP, FLAG_ACTIVITY_SINGLE_TOP, FLAG_ACTIVITY_CLEAR_TASK, FLAG_ACTIVITY_NO_HISTORY, FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS, FLAG_ACTIVITY_NO_ANIMATION, and FLAG_ACTIVITY_REORDER_TO_FRONT.

Important

Don't configure broadcast intents that target Intune management-critical apps, including Intune, Microsoft Authenticator, Company Portal, and Cloud DPC. These broadcasts are blocked. Activity intents can't target custom classes in Intune management-critical apps. For Microsoft Authenticator, Intune, Managed Home Screen, and Remote Help, you can launch the app's main screen, but you can't target a custom class.

Local actions JSON schema

Local actions use the Android Enterprise managed configuration format. The top-level key is com.microsoft.intune.localactions, and its valueBundleArray contains the trigger-and-action bundles.

The complete schema is:

{
  "kind": "androidenterprise#managedConfiguration",
  "productId": "app:com.microsoft.intune",
  "managedProperty": [
    {
      "key": "com.microsoft.intune.localactions",
      "valueBundleArray": [
        {
          "managedProperty": [
            {
              "key": "trigger",
              "valueString": ""
            },
            {
              "key": "actions",
              "valueBundleArray": [
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "activity"
                    },
                    {
                      "key": "package",
                      "valueString": ""
                    },
                    {
                      "key": "class",
                      "valueString": ""
                    },
                    {
                      "key": "action",
                      "valueString": ""
                    },
                    {
                      "key": "data_uri",
                      "valueString": ""
                    },
                    {
                      "key": "mime_type",
                      "valueString": ""
                    },
                    {
                      "key": "flags",
                      "valueString": ""
                    },
                    {
                      "key": "extras",
                      "valueBundleArray": [
                        {
                          "managedProperty": [
                            {
                              "key": "extra_key",
                              "valueString": ""
                            },
                            {
                              "key": "extra_value",
                              "valueString": ""
                            },
                            {
                              "key": "extra_type",
                              "valueString": "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Replace the empty strings with the values for your trigger and actions. You can omit optional properties that you don't use. For each additional trigger, add another bundle to the top-level valueBundleArray.

Note

Actions run in configuration order. You can configure up to five actions for each trigger. If you configure more than five, only the first five run.

JSON examples

Use these examples as starting points, and replace the example package, class, action, and extra values with values from the app developer.

Launch an app after device reboot

This example launches the main activity of com.example.safetyapp after the device reboots. This activity action requires Overlay Permission.

{
  "kind": "androidenterprise#managedConfiguration",
  "productId": "app:com.microsoft.intune",
  "managedProperty": [
    {
      "key": "com.microsoft.intune.localactions",
      "valueBundleArray": [
        {
          "managedProperty": [
            {
              "key": "trigger",
              "valueString": "device_reboot"
            },
            {
              "key": "actions",
              "valueBundleArray": [
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "activity"
                    },
                    {
                      "key": "package",
                      "valueString": "com.example.safetyapp"
                    },
                    {
                      "key": "action",
                      "valueString": "android.intent.action.MAIN"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Send a broadcast after global sign-out

This example sends a custom broadcast to an example app after global sign-out.

{
     "kind": "androidenterprise#managedConfiguration",
     "productId": "app:com.microsoft.intune",
     "managedProperty": [
       {
     "key": "com.microsoft.intune.localactions",
     "valueBundleArray": [
         {
             "managedProperty": [
                 {
                     "key":"trigger",
                     "valueString": "global_sign_out"
                 },
                 {
                     "key": "actions",
                     "valueBundleArray": [
                         {
                             "managedProperty": [
                                 {
                                     "key":"action_type",
                                     "valueString": "broadcast"
                                 },
                                 {
                                     "key":"package",
                                     "valueString": "com.contoso.examplePackageName"
                                 },
                                 {
                                     "key":"class",
                                     "valueString": "com.contoso.example.fullyQualifiedClassName"
                                 },
                                 {
                                     "key":"action",
                                     "valueString": "com.contoso.example.EXAMPLE_CUSTOM_LOB_ACTION"
                                 },
                                 {
                                     "key": "extras",
                                     "valueBundleArray": [
                                         {
                                             "managedProperty": [
                                                 {"key": "extra_key",
     "valueString": "example_extra_key_1"},
                                                 {"key": "extra_value",
   "valueString": "example_extra_value_1"},
                                                 {"key": "extra_type",
"valueString": "string"}
                                             ]
                                         },
                                         {
                                             "managedProperty": [
                                                 {"key": "extra_key",
    "valueString": "example_extra_key_2"},
                                                 {"key": "extra_value",
"valueString": "true"},
                                                 {"key": "extra_type",
"valueString": "boolean"}
                                             ]
                                         }
                                     ]
                                 }
                             ]
                         }
                     ]
                 }
             ]
         }
     ]
       }
     ]
 }

Run multiple actions after device reboot

This example launches two apps and sends a broadcast after the device reboots. The activity actions require Overlay Permission.

{
  "kind": "androidenterprise#managedConfiguration",
  "productId": "app:com.microsoft.intune",
  "managedProperty": [
    {
      "key": "com.microsoft.intune.localactions",
      "valueBundleArray": [
        {
          "managedProperty": [
            {
              "key": "trigger",
              "valueString": "device_reboot"
            },
            {
              "key": "actions",
              "valueBundleArray": [
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "activity"
                    },
                    {
                      "key": "package",
                      "valueString": "com.example.app1"
                    },
                    {
                      "key": "action",
                      "valueString": "android.intent.action.MAIN"
                    }
                  ]
                },
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "activity"
                    },
                    {
                      "key": "package",
                      "valueString": "com.example.app2"
                    },
                    {
                      "key": "action",
                      "valueString": "android.intent.action.MAIN"
                    }
                  ]
                },
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "broadcast"
                    },
                    {
                      "key": "package",
                      "valueString": "com.example.notifyapp"
                    },
                    {
                      "key": "action",
                      "valueString": "com.example.notifyapp.DEVICE_READY"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Sign out of Managed Home Screen when docked

This example initiates a Managed Home Screen sign-out when the device connects to a charger or dock.

{
  "kind": "androidenterprise#managedConfiguration",
  "productId": "app:com.microsoft.intune",
  "managedProperty": [
    {
      "key": "com.microsoft.intune.localactions",
      "valueBundleArray": [
        {
          "managedProperty": [
            {
              "key": "trigger",
              "valueString": "device_plugged_in"
            },
            {
              "key": "actions",
              "valueBundleArray": [
                {
                  "managedProperty": [
                    {
                      "key": "action_type",
                      "valueString": "direct_api"
                    },
                    {
                      "key": "action",
                      "valueString": "mhs_sign_out"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Launch an app on a schedule

This example launches a safety check-in app at 6:00 AM every weekday. This activity action requires Overlay Permission.

{
    "kind": "androidenterprise#managedConfiguration",
    "productId": "app:com.microsoft.intune",
    "managedProperty": [
        {
            "key": "com.microsoft.intune.localactions",
            "valueBundleArray": [
                {
                    "managedProperty": [
                        {
                           "key": "trigger",
                            "valueString": "schedule"
                        },
                        {
                            "key": "schedule_time",
                            "valueString": "06:00"
                        },
                        {
                            "key": "schedule_days",
    "valueString": "monday,tuesday,wednesday,thursday,friday"
                        },
                        {
                            "key": "actions",
                            "valueBundleArray": [
                                {
                                    "managedProperty": [
                                        {
                                            "key": "action_type",
                                            "valueString": "activity"
                                        },
                                        {
                                            "key": "package",
                                            "valueString":"com.contoso.safetycheck"
                                        },
                                        {
                                            "key": "action",
"valueString":"android.intent.action.MAIN"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

\ No newline at end of file

Daily Intune.Admin.News

Get daily email updates

Get a concise summary of the latest Microsoft Intune updates delivered straight to your inbox.

Loading the secure signup form…