Devices

For a list of methods for this resource, see the end of this page.

Resource representations

A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.

{
  "kind": "androidenterprise#device",
  "androidId": string,
  "managementType": string,
  "policy": {
    "autoUpdatePolicy": string,
    "productAvailabilityPolicy": string,
    "productPolicy": [
      {
        "productId": string,
        "tracks": [
          string
        ],
        "trackIds": [
          string
        ],
        "managedConfiguration": {
          "kind": string,
          "productId": string,
          "managedProperty": [
            {
              "key": string,
              "valueBool": boolean,
              "valueInteger": integer,
              "valueString": string,
              "valueStringArray": [
                string
              ],
              "valueBundle": {
                "managedProperty": [
                  (ManagedProperty)
                ]
              },
              "valueBundleArray": [
                {
                  "managedProperty": [
                    (ManagedProperty)
                  ]
                }
              ]
            }
          ],
          "configurationVariables": {
            "kind": "androidenterprise#configurationVariables",
            "mcmId": string,
            "variableSet": [
              {
                "kind": "androidenterprise#variableSet",
                "placeholder": string,
                "userValue": string
              }
            ]
          }
        },
        "autoInstallPolicy": {
          "autoInstallMode": string,
          "autoInstallPriority": integer,
          "autoInstallConstraint": [
            {
              "networkTypeConstraint": string,
              "chargingStateConstraint": string,
              "deviceIdleStateConstraint": string
            }
          ],
          "minimumVersionCode": integer
        },
        "autoUpdateMode": string,
        "enterpriseAuthenticationAppLinkConfigs": [
          {
            "uri": string
          }
        ]
      }
    ],
    "maintenanceWindow": {
      "startTimeAfterMidnightMs": long,
      "durationMs": long
    },
    "deviceReportPolicy": string,
    "policyId": string
  },
  "report": {
    "lastUpdatedTimestampMillis": long,
    "appState": [
      {
        "packageName": string,
        "keyedAppState": [
          {
            "key": string,
            "stateTimestampMillis": long,
            "severity": string,
            "message": string,
            "data": string
          }
        ]
      }
    ]
  },
  "latestBuildFingerprint": string,
  "sdkVersion": integer,
  "maker": string,
  "model": string,
  "device": string,
  "product": string,
  "retailBrand": string
}
Property name Value Description Notes
androidId string The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
device string The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
kind string
latestBuildFingerprint string The build fingerprint of the device if known.
maker string The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
managementType string Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.

Possible values include:
  • "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
  • "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
  • "containerApp", no longer used (deprecated).
  • "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.


Acceptable values are:
  • "containerApp"
  • "managedDevice"
  • "managedProfile"
  • "unmanagedProfile"
model string The model name of the device. This comes from android.os.Build.MODEL.
policy nested object The policy enforced on the device.
policy.autoUpdatePolicy string Controls when automatic app updates on the device can be applied.

Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency.

When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect.
  • choiceToTheUser allows the device's user to configure the app update policy.
  • always enables auto updates.
  • never disables auto updates.
  • wifiOnly enables auto updates only when the device is connected to wifi.


Acceptable values are:
  • "always"
  • "choiceToTheUser"
  • "never"
  • "wifiOnly"
policy.deviceReportPolicy string Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".

Acceptable values are:
  • "deviceReportDisabled"
  • "deviceReportEnabled"
policy.maintenanceWindow nested object The maintenance window defining when apps running in the foreground should be updated.
policy.maintenanceWindow.durationMs long Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
policy.maintenanceWindow.startTimeAfterMidnightMs long Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
policy.policyId string An identifier for the policy that will be passed with the app install feedback sent from the Play Store.
policy.productAvailabilityPolicy string The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.

Acceptable values are:
  • "all"
  • "whitelist"
policy.productPolicy[] list The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
policy.productPolicy[].autoInstallPolicy nested object The auto-install policy for the product.
policy.productPolicy[].autoInstallPolicy.autoInstallConstraint[] list The constraints for auto-installing the app. You can specify a maximum of one constraint.

policy.productPolicy[].autoInstallPolicy.autoInstallConstraint[].chargingStateConstraint string Charging state constraint.

Acceptable values are:
  • "chargingNotRequired"
  • "chargingRequired"
policy.productPolicy[].autoInstallPolicy.autoInstallConstraint[].deviceIdleStateConstraint string Device idle state constraint.

Acceptable values are:
  • "deviceIdleNotRequired"
  • "deviceIdleRequired"
policy.productPolicy[].autoInstallPolicy.autoInstallConstraint[].networkTypeConstraint string Network type constraint.

Acceptable values are:
  • "anyNetwork"
  • "unmeteredNetwork"
policy.productPolicy[].autoInstallPolicy.autoInstallMode string The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.

Acceptable values are:
  • "autoInstallOnce"
  • "doNotAutoInstall"
  • "forceAutoInstall"
policy.productPolicy[].autoInstallPolicy.autoInstallPriority integer The priority of the install, as an unsigned integer. A lower number means higher priority.
policy.productPolicy[].autoInstallPolicy.minimumVersionCode integer The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
policy.productPolicy[].autoUpdateMode string The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.

Acceptable values are:
  • "autoUpdateDefault"
  • "autoUpdateHighPriority"
  • "autoUpdatePostponed"
policy.productPolicy[].enterpriseAuthenticationAppLinkConfigs[] list An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
policy.productPolicy[].enterpriseAuthenticationAppLinkConfigs[].uri string An authentication url.
policy.productPolicy[].managedConfiguration nested object The managed configuration for the product.
policy.productPolicy[].managedConfiguration.configurationVariables nested object Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user.
policy.productPolicy[].managedConfiguration.configurationVariables.kind string
policy.productPolicy[].managedConfiguration.configurationVariables.mcmId string The ID of the managed configurations settings.
policy.productPolicy[].managedConfiguration.configurationVariables.variableSet[] list The variable set that is attributed to the user.
policy.productPolicy[].managedConfiguration.configurationVariables.variableSet[].kind string
policy.productPolicy[].managedConfiguration.configurationVariables.variableSet[].placeholder string The placeholder string; defined by EMM.
policy.productPolicy[].managedConfiguration.configurationVariables.variableSet[].userValue string The value of the placeholder, specific to the user.
policy.productPolicy[].managedConfiguration.kind string Deprecated.

policy.productPolicy[].managedConfiguration.managedProperty[] list The set of managed properties for this configuration.
policy.productPolicy[].managedConfiguration.managedProperty[].key string The unique key that identifies the property.
policy.productPolicy[].managedConfiguration.managedProperty[].valueBool boolean The boolean value - this will only be present if type of the property is bool.
policy.productPolicy[].managedConfiguration.managedProperty[].valueBundle nested object The bundle of managed properties - this will only be present if type of the property is bundle.
policy.productPolicy[].managedConfiguration.managedProperty[].valueBundle.managedProperty[] list The list of managed properties.
policy.productPolicy[].managedConfiguration.managedProperty[].valueBundleArray[] list The list of bundles of properties - this will only be present if type of the property is bundle_array.
policy.productPolicy[].managedConfiguration.managedProperty[].valueBundleArray[].managedProperty[] list The list of managed properties.
policy.productPolicy[].managedConfiguration.managedProperty[].valueInteger integer The integer value - this will only be present if type of the property is integer.
policy.productPolicy[].managedConfiguration.managedProperty[].valueString string The string value - this will only be present if type of the property is string, choice or hidden.
policy.productPolicy[].managedConfiguration.managedProperty[].valueStringArray[] list The list of string values - this will only be present if type of the property is multiselect.
policy.productPolicy[].managedConfiguration.productId string The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
policy.productPolicy[].productId string The ID of the product. For example, "app:com.google.android.gm".
policy.productPolicy[].trackIds[] list Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
policy.productPolicy[].tracks[] list Deprecated. Use trackIds instead.
product string The product name of the device. This comes from android.os.Build.PRODUCT.
report nested object The device report updated with the latest app states.
report.appState[] list List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
report.appState[].keyedAppState[] list List of keyed app states. This field will always be present.
report.appState[].keyedAppState[].data string Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
report.appState[].keyedAppState[].key string Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
report.appState[].keyedAppState[].message string Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
report.appState[].keyedAppState[].severity string Severity of the app state. This field will always be present.

Acceptable values are:
  • "severityError"
  • "severityInfo"
report.appState[].keyedAppState[].stateTimestampMillis long Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
report.appState[].packageName string The package name of the app. This field will always be present.
report.lastUpdatedTimestampMillis long The timestamp of the last report update in milliseconds since epoch. This field will always be present.
retailBrand string Retail brand for the device, if set. See android.os.Build.BRAND
sdkVersion integer API compatibility version.

Methods

forceReportUpload
Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device.
get
Retrieves the details of a device.
getState
Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
list
Retrieves the IDs of all of a user's devices.
setState
Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
update
Updates the device policy.

To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package. See restrict accounts in Google Play.