3

I used this quick start guide to setup my project and enterprise. Currently the project is under 'No Organization' on the Google Cloud Console hierarchy.

I have setup the following device policy with a single app in kiosk mode. The app is restricted to a single country and is developed in-house.

{
    "safeBootDisabled": true,
    "screenCaptureDisabled": true,
    "factoryResetDisabled": true,
    "systemUpdate": {
        "type": "WINDOWED",
        "startMinutes": 0,
        "endMinutes": 240
    },
    "applications": [
        {
            "packageName": "com.xxx.yyy",
            "installType": "KIOSK",
            "defaultPermissionPolicy": "GRANT"
        }
    ],
    "debuggingFeaturesAllowed": true,
    "funDisabled": true,
    "appAutoUpdatePolicy": "WIFI_ONLY",
    "kioskCustomization": {
        "statusBar": "NOTIFICATIONS_AND_SYSTEM_INFO_ENABLED"
    }
}

I currently use the QR method to provision devices.

The problem I am having is that the provisioning process is failing at the stage when the app is being installed.

When I use this API to check what went wrong I can see that it failed because of the following error:

{
    "nonComplianceDetails": [
        {
            "settingName": "applications",
            "nonComplianceReason": "APP_NOT_INSTALLED",
            "packageName": "com.xxx.yyy",
            "installationFailureReason": "NOT_AVAILABLE_IN_COUNTRY"
        },
        {
            "settingName": "persistentPreferredActivities",
            "nonComplianceReason": "APP_NOT_INSTALLED",
            "packageName": "com.xxx.yyy"
        }
    ]
}

If I change my device policy from install type "KIOSK" to "AVAILIBLE" the device is successfully provisioned. I can then install the app from the Play store and reset the install type to "KIOSK" mode.

But this is far from ideal because the entire device fleet of 85 production devices settings', are then changed just to provision a single device.

So it seems that while provisioning the device the location settings are incorrect?

Does anybody know why this is happening?

Johan Ferreira
  • 515
  • 4
  • 15
  • After opening a ticket on Google Cloud Support I got a temporary fix for this problem. Create a new policy under the same enterprise with the app installType set to AVAILABLE. Then after the device has been enrolled into the policy, install the app through the Play Store. Then request the devices.patch() method (https://developers.google.com/android/management/reference/rest/v1/enterprises.devices/patch) and move the device to the initial policy. At least with this method you don't have to change your production device policy. – Johan Ferreira Jan 05 '21 at 09:22
  • You can also semi-automate this process using a Python script. – Johan Ferreira Jan 05 '21 at 09:22
  • Is there any update on this? Maybe there's something we're missing... – Jonas S. May 04 '23 at 11:19
  • 1
    @JonasS. Unfortunately, I haven't found a solution for this yet. Still setting up the devices with installType set to "AVAILABLE" and then moving them over to "KIOSK" with a python script. – Johan Ferreira May 08 '23 at 07:20

1 Answers1

2

Try to create a separate policy just for this device so that you can provision it without affecting other devices, and once provisioned, you can update which policy is applied to the device to be the same to all other devices.

You can use policies.patch to update the policy or devices.patch.

This also could be for a lack of Kiosk support mode for a given app as KIOSK required the app to have an official “lock task mode” per https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode.

Deyzel
  • 186
  • 5
  • How did you managed to solve it? I'm experiencing the same problem – app does not install in Kiosk mode. Only creating a different policy and later changing it to Kiosk mode solves it. Is lock task mode required even when using Android Management API? What kind of code is required to include in the app? – Jonas S. May 04 '23 at 10:25