Search code examples
android-management-api

Custom Android app not launched during Android Management API enrollment with the setupActions keyword


Following the Android Management API reference, we've configured our Android Companion App to be automatically launched during the enrollment.

We've added the following information in our policy configuration:

{
  "name": "enterprises/XXX/policies/85f57716-8b02-48f2-abdf-5aeb6beef585",
  "version": "1",
  "applications": [
    {
      "packageName": "app.XXX.companionapp.test",
      "installType": "REQUIRED_FOR_SETUP",
      "defaultPermissionPolicy": "GRANT",
      "managedConfiguration": {
        "namespace": "XXX",
        "enterpriseId": "enterprises/XXX"
      }
    }
  ],
  "openNetworkConfiguration": {
    "NetworkConfigurations": [
      {
        "Type": "WiFi",
        "GUID": "a0989e28-9c23-43e5-b5d3-9b37d86723a3",
        "WiFi": {
          "AutoConnect": false,
          "Passphrase": "XXX",
          "Security": "WPA-PSK",
          "SSID": "SFR-9548"
        },
        "Name": "XXX"
      }
    ]
  },
  "systemUpdate": {
    "type": "AUTOMATIC"
  },
  "safeBootDisabled": true,
  "statusReportingSettings": {
    "applicationReportsEnabled": true,
    "deviceSettingsEnabled": true,
    "softwareInfoEnabled": true,
    "memoryInfoEnabled": true,
    "networkInfoEnabled": true,
    "displayInfoEnabled": true,
    "powerManagementEventsEnabled": true,
    "hardwareStatusEnabled": true
  },
  "stayOnPluggedModes": [
    "BATTERY_PLUGGED_MODE_UNSPECIFIED"
  ],
  "locationMode": "HIGH_ACCURACY",
  "appAutoUpdatePolicy": "ALWAYS",
  "playStoreMode": "WHITELIST",
  "setupActions": [
    {
      "launchApp": {
        "packageName": "app.XXX.companionapp.test"
      },
      "title": {
        "defaultMessage": "Companion"
      },
      "description": {
        "defaultMessage": "Install Companion App to run custom tasks on your device."
      }
    }
  ],
  "passwordPolicies": [
    {}
  ]
}

It used to work well, but lately, our companion app is not launched anymore during enrollment, whereas it's actually installed on the device.

Do you have any idea about what could be wrong?

Thanks a lot in advance.

PS: There is a mismatch in the SetupAction key. In the Android Management API guides, it refers to setupAction, and in the API documentation it refers to setupActions.


Solution

  • There was an issue on Google's side preventing the new setupActions feature to work. This issue is now fixed and the feature is now working properly.