Add CarServiceUtils.finishAllHandlerTasks for test

- As handler threads are shared among the tests for car serivce, pending
  handler task can affect the next test.
- This call quarantees that all queued handler tasks are complete.
- For CarServiceUnitTest, adding this is left for each test as most tests
  should not be affected by other handler tasks.
- For CarServiceTest, add it to common MockedCarTestBase as there are so many
  handlers used.

Bug: 154927360
Test: atest CarServiceTest CarServiceUnitTest
Change-Id: Id5b6f3da80041227e4c839bb9dd27a268ad119da
3 files changed
tree: c1184e01b9b0deddcf2061889287bea3e325366c
  1. car-bugreportd/
  2. car-default-input-service/
  3. car-internal-lib/
  4. car-lib/
  5. car-maps-placeholder/
  6. car-systemtest-lib/
  7. car-test-lib/
  8. car-usb-handler/
  9. car_product/
  10. computepipe/
  11. EncryptionRunner/
  12. evs/
  13. experimental/
  14. FrameworkPackageStubs/
  15. obd2-lib/
  16. procfs-inspector/
  17. service/
  18. surround_view/
  19. tests/
  20. tools/
  21. user/
  22. vehicle-hal-support-lib/
  23. watchdog/
  24. .clang-format
  25. .gitignore
  26. Android.mk
  27. CleanSpec.mk
  28. CPPLINT.cfg
  29. OWNERS
  30. PREUPLOAD.cfg
  31. README.md
  32. TEST_MAPPING
README.md

Native (C++) code format is required to be compatible with .clang-format file. Run

git clang-format --style=file --extension='h,cpp,cc' HEAD~

Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.