Fix DeviceOwnerTargetPreparer for headless system user
Removes functionality that assumes the primary user is not 0, as
in practice they are the same.
Also removes device admin from main user for HSUM devices to allow
the package to be uninstalled.
And implements the uninstall logic so that tests don't have to
manually add an final uninstall step.
Bug: 267492062
Bug: 268271623
Test: tradefed > run host --class
com.android.tradefed.targetprep.DeviceOwnerTargetPreparerTest
Change-Id: I18964355c92f26cc91c917e726e89eb20ef5dedd
TF is a test harness used to drive Android automated testing. It runs on test hosts and monitors the connected devices, handling test scheduling & execution and device management.
Other test harnesses like Compatibility Test Suite (CTS) and Vendor Test Suite (VTS) use TF as a basis and extend it for their particular needs.
1. Create your change in Gerrit 2. Add the reviewer named "Tradefed Codereview" (email: tradefed-codereview@tradefederation.google.com.iam.gserviceaccount.com) 3. Review the code review guidance at go/tf-guidelines and go/tradefed-code-reviews 4. GWSQ should add a couple of people from the team to review your code and give feedback.
More information at: https://source.android.com/docs/core/tests/tradefed/
See more details about Tradefed Architecture at: https://source.android.com/docs/core/tests/tradefed/architecture
If you are a tests writer you should start looking in the test_framework/ component which contains everything needed to write a tests in Tradefed.