Fixing CarUserServiceTest#testOnUserLifecycleEvent_nofityListener

CarUserService now invokes UserLifecycleListener in it's own handler
thread. Tests needs some sort of synchronization when checking if
listener's onEvent method was properly invoked. This solution uses
a wrapper containing a CountdownLatch, to be used by CarUserService to
notify test to proceed when onEvent is invoked.

Bug: 153834987
Test: atest CarServiceUnitTest:com.android.car.user.CarUserServiceTest#testOnUserLifecycleEvent_nofityListener
Test: atest CarServiceUnitTest:com.android.car.user.CarUserServiceTest#testOnUserLifecycleEvent_ensureAllListenersAreNotified
Change-Id: Ia3ade1839bb97a720ddab1d506ef818b6360632a
1 file changed
tree: 6c4e84f10a1ea567100f5bc1b3ab86b932df0035
  1. car-bugreportd/
  2. car-default-input-service/
  3. car-lib/
  4. car-maps-placeholder/
  5. car-systemtest-lib/
  6. car-test-lib/
  7. car-usb-handler/
  8. car_product/
  9. computepipe/
  10. EncryptionRunner/
  11. evs/
  12. experimental/
  13. FrameworkPackageStubs/
  14. obd2-lib/
  15. procfs-inspector/
  16. service/
  17. surround_view/
  18. tests/
  19. tools/
  20. user/
  21. vehicle-hal-support-lib/
  22. watchdog/
  23. .clang-format
  24. .gitignore
  25. Android.mk
  26. CleanSpec.mk
  27. CPPLINT.cfg
  28. OWNERS
  29. PREUPLOAD.cfg
  30. README.md
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.