Search code examples
androidandroid-management-api

Disable system navigation in kiosk mode


I have been trying to disable the system navigation in kiosk mode from the profile in android management API

this is the profile that trying to update

{
  "applications": [
    {
      "packageName": "com.example.demo",
      "installType": "FORCE_INSTALLED"
    }
  ],  
  "kioskCustomLauncherEnabled": true,
  "keyguardDisabled": true,
  "statusBarDisabled": true,
  "kioskCustomization": {
     "systemNavigation": enum (NAVIGATION_DISABLED)
  },
  "debuggingFeaturesAllowed": true
}

On applying the kiosk customisation, this is the error that is coming up. The profile is updated successfully when the 'kioskCustomization' is not applied

/usr/lib/python3.6/json/decoder.py in raw_decode(self, s, idx)
    355             obj, end = self.scan_once(s, idx)
    356         except StopIteration as err:
--> 357             raise JSONDecodeError("Expecting value", s, err.value) from None
    358         return obj, end

JSONDecodeError: Expecting value: line 13 column 26 (char 273)

I am assuming that the enum for disabling the navigation is of the incorrect format

Thanks


Solution

  • The format should be like this:

    "systemNavigation": “NAVIGATION_DISABLED”
    

    Note that ENUM types just let you know that only a specific set of strings can be used as the value in the policy.

    The valid enum values for systemNavigation : https://developers.google.com/android/management/reference/rest/v1/enterprises.policies#systemnavigation