Fix drive state property events synchronization

The heart of the deadlock is caused by dispatching callbacks. By
doing the dispatch logic on a seprate thread, we avoid the
deadlock scenario.

Ideally the client that registers with CarDrivingStateService
should be able to specify the handler used for receiving
callbacks, however, that would require an API change and is
out of scope for this fix.

This change should be simple and understandable enough
to be considered low-risk for qpr2.

Bug: 142804287
Test: atest CarUxRestrictionsManagerServiceTest
Change-Id: I875c83ca46e4ce5d9d1b36b2589f1ea99023c3fa
2 files changed
tree: f778960c7eb4fdc73cf68a5181d94507dcb9f8bb
  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. FrameworkPackageStubs/
  13. obd2-lib/
  14. procfs-inspector/
  15. service/
  16. tests/
  17. tools/
  18. user/
  19. vehicle-hal-support-lib/
  20. .clang-format
  21. .gitignore
  22. Android.mk
  23. CleanSpec.mk
  24. OWNERS
  25. PREUPLOAD.cfg
  26. 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.