Search code examples
androidgoogle-console-developerandroid-management-api

Android Management API and VpnService


I'm using android tablets in kiosk mode where only one application is allowed. And I also use 3G network. To save traffic, I use the special launcher on every application which uses VpnService android API. And also this launcher prevents a user from accessing to other apps.

Android Management API provides kiosk mode functionality, but I don't see any reference to VPN configuration. How can I configure network traffic with it?


Solution

  • You can configure always-on-VPN with the Android Management API by setting alwaysOnVpnPackage and vpnConfigDisabled in the Policy:

    {
      "applications": [
        {
          "packageName": "my.vpn.app",
          "installType": "FORCE_INSTALLED",
          "defaultPermissionPolicy": "GRANT"
        },
      ],
      "alwaysOnVpnPackage": {
        "packageName": "my.vpn.app",
        "lockdownEnabled": true
      },
      "vpnConfigDisabled": true
    }
    

    If your VPN app supports managed configurations you can configure it via the Policy without manual interaction. Otherwise you will have to configure the VPN app manually the first time before turning on kiosk mode.