Simplify ApexE2EBaseHostTest

* Instead of waiting for 10 seconds, poll for session to become ready
  every 200ms with TTL of 10s.
* Add logging to have better understanding how long does it take for
  session to become ready.
* Use adb uninstall instead of brutally wiping out /data/apex.
* Don't reboot a device in case uninstall of apex failed: this
  means that most likely apex wasn't installed in the first place, so
  there is no need in rebooting.

I did some measurements, with this CL:
testStageActivatUninstallTwice: ~4m40
testStageActivateUninstallApexPackage: ~3m

All numbers are approximate average over 5 runs on the
aosp_cf_x86_phone-eng.

There are several more optimizations that we can probably make:
1. Wait for the session ready broadcast in the
  PackageManagerShellCommand.
2. In apexd, when uninstalling an apex that is not referenced by any
  process, simply deactivate it without requiring a reboot.

Bug: 124582823
Test: apex_e2e_tests
Change-Id: Ia4024e7a9c49b2613a4f1e62da8dd834b26cb776
Merged-In: Ia4024e7a9c49b2613a4f1e62da8dd834b26cb776
(cherry picked from commit 2367685e55bad48ea58605c9edbac682200f8eb9)
1 file changed
tree: ee76c3ab88b66da3f7626f873ade861a092ed1f3
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. OWNERS
  7. PREUPLOAD.cfg