Teardown state after each test except when in enterprise-specific modules.

The idea here is that when running tests as part of a normal module,
each test will leave the state clear. When running in a
enterprise-specific module then we assume each test knows that it must
take care of incoming state so we skip this cleanup phase after each
test (allowing some state sharing).

When running tests during local development, you can use atest
CtsDevicePolicyTestCases -- --module-arg
CtsDevicePolicyTestCases:instrumentation-arg:skip-test-teardown:=true

There will be a module equivalent added to avoid cleaning up when
running in a run consisting of only enterprise-specific modules.

Additionally, a TargetPreparer will need to be created to clean up the
state at the end of the module if any was left over from tests.

Test: atest CtsDevicePolicyTestCases -- --module-arg CtsDevicePolicyTestCases:instrumentation-arg:skip-test-teardown:=true
Bug: 167945074
Change-Id: I99e6f5f628784e8f9285cc4b3410a5886dfa96c9
5 files changed