How to keep system apps from being removed during device provisioning via Android Management API

I am generating a QR enrollment code using the Android Management API; however, the system apps such as Camera, Calculator etc get removed by the DPC upon enrollment in fully managed mode.

Other posts have mentioned that you must add the following to the object generated by the enrollmentTokens.create() method:"] = true

What I am currently doing currently is:

  1. Generate the QR code with the following python code:
androidmanagement = build(
    "androidmanagement", "v1", credentials=credentials

enrollment_token = (
            "policyName": policy_name,
            "user": {"accountIdentifier": f"{some_identifier}"},
            "oneTimeOnly": "TRUE",
  1. Then add the property
res = json.loads(enrollment_token["qrCode"])

res[""] = True

formatted_object_string = json.dumps(res)

enrollment_obj = formatted_object_string.replace(" ", "")

If you print enrollment_obj you get:

This object is used to create a QR code link that looks like the following (without obfuscated data of course):<SOME_CHECKSUM><SOME_ENROLLMENT_TOKEN>

This will allow an enrollment; however, the DPC does not seem to honor the added property. Can anyone see where I may be going wrong?


NGINX Controller Application Delivery Modules Improves Health Checks and Caching Configurations

Golang AWS SAM Lambda example