Compatibility Service User Guide

The Compatibility service is a subservice of the Google Android Partner API. This service enables Android partners to upload Android Compatibility Test Suite reports and manage Android device launches. Currently, Android partners can upload test suite reports (CTS, GTS, VTS, etc.) using the Upload Portal and manage Android device launches using the Approvals Portal; the Compatibility service API provides another way for Android partners to achieve the same goal.

Android partners can use the Compatibility service to retrieve, list, and update devices, products, and builds they have created before. After the Google Android partner team approves a device based on its test results, Android partners can also use the service to mark that product as Launched.

Resources

The Compatibility service operates on the following resources:

  • Device: Android device.
  • Product: Android product that has market information.
  • Build: Software that runs on the Android device.
  • Report: Android test suite report.
  • Waiver: Waiver that is granted by the Android partner team.
  • CPU: The CPU on a device.
  • Retail Branding: Product retail branding.
  • ODM: Device ODM information.
  • OtaDeploymentGroup: OTA (Over the Air) deployment group information.

Client capabilities

Android partners start by uploading a CTS report. Based on the information in that test report, the Compatibility service parses and stores the report, then creates the corresponding "Device, Product, Build, Report" data structure on the backend. The client can then:

  • Use standard get, list, and update methods to retrieve, list, and update Device, Product, and Build.
  • Retrieve and list Waivers granted by the Android partner team.
  • List existing CPU, RetailBranding, and ODM information, then use this information in update methods.

Examples

To create and update "Device, Product, Build, Report", the client must first upload a valid CTS test report as a zip file (the client can then download this zip file as needed). The following sections provide detailed instructions for uploading and downloading a report, as well as example commands for getting a list of devices, products, builds, reports, or waivers.

Upload a report

  1. Start an upload session.

    curl -X POST https://androidpartner.googleapis.com/v1/compatibility/report:startUploadReport
    

    The server should return a message similar to:

    {
      "reportRef": {
        "name": "5ad3c4cf-f00d-4c00-a012-ca3db13d5bf4"
      }
    }
    

    "5ad3c4cf-f00d-4c00-a012-ca3db13d5bf4" is the resource name; we will use it in the next upload session.

  2. Use the "reportRef name" to upload an object.

    curl -X POST -T {path_to_report} https://androidpartner.googleapis.com/upload/v1/media/5ad3c4cf-f00d-4c00-a012-ca3db13d5bf4?upload_type=media
    

  3. Create a report under company ID 0 using the report that was uploaded.

    curl -X POST -d "{ report_ref : { name : '5ad3c4cf-f00d-4c00-a012-ca3db13d5bf4' }, company_id: 0 }" https://androidpartner.googleapis.com/v1/compatibility/report
    
    Please contact your Google TAM if unsure about company_id.

Report validation

Compatibility reports uploaded are validated to ensure they meet the minimum set of requirements for device approval review. These requirements are as follows:

  • Compatibility reports are generated with the latest versions test suite, e.g.
  • Fields in the compatibility report that are important for identification are scrutinized as follows:
    • Model, ID, and Android Version cannot be empty.
    • Device, Product, and Brand must match the regular expression: “[a-zA-Z0-9.,_-]+”.
    • Fingerprint cannot contain whitespace characters.
    • Manufacturer and brand cannot be "Generic" and "Unknown".
  • Component values of the fingerprint must match the related values elsewhere in the compatibility report.
  • Model, manufacturer, device, product, ID, and android version are consistent for reports for a device with the same fingerprint over time.

Compatibility reports that do not not meet these requirements are rejected. When a report is rejected, the API response body will contain the reasons for rejection.

Download a report

  1. Start a download session.

    For example, to download a report that has "name" as "devices/136D60F1/products/87826ABE/builds/797EE92C/reports/4D08A640"

    curl -X POST -d "{ name : "devices/136D60F1/products/87826ABE/builds/797EE92C/reports/4D08A640" }" https://androidpartner.googleapis.com/v1/compatibility/report:downloadReport
    

    The server should return a message similar to:

    {
      "reportRef": {
      "name": "ac570817-1d7b-4a6d-bb6c-0e06a42d0d4c"
    }
    

  2. Use the name in the "reportRef" to download the report.

    curl https://androidpartner.googleapis.com/v1/media/ac570817-1d7b-4a6d-bb6c-0e06a42d0d4c?alt=media
    

List devices

curl https://androidpartner.googleapis.com/v1/compatibility/devices

The server should return a message similar to:

    {
      "name": "devices/EA18EC03",
      "deviceName": "shamu",
      "companyId": "1",
      "companyName": "Google"
    }

List a device

curl https://androidpartner.googleapis.com/v1/compatibility/devices/EA18EC03