Fix built-in controller registration flow.

Built-in controller registration flow is wrong, breaking the use
case where more than one test class is executed in a test run.
It should follow the same flow as controller modules registered
by the test classes.

The import, registration, and unregistration should happen once for
each test class in each test run, for all controller modules.

Added a unit test for this use case as well.

Bug=29196491

Cherry-pick of https://android-review.googlesource.com/#/c/237131/
Change-Id: Icdda688e8569686589b27a7234ea982401f4eb9d
2 files changed
tree: a75e2b3b6e66766057d59d0d7887f57f9bba55b1
  1. acts/
  2. Android.mk