Add new createCar with CarServiceLifecycleListener

- CarServiceLifecycleListener is always called regardless of car service
  already published through ServiceManager or not. Client is supposed to
  implement initialization code inside the listener. If client is calling it
  from main thread, initialization will happen inside the call if car service
  is already available or become available before wait timeout happens.
- Removed explicit disconnect from default disconnect handler as car service
  should be bound for the client always unless client ask for disconnect.
- Expanded CarTest for new API. Also added kitchen sink test to cover all
  three flavours available now. We will migrate to this one in the end and
  can drop all others.
- Also refactored lock usage to single mLock as the current double locks
  does not bring much value.
- Updated kitchensink selinux policy to allow access to car_service binder.
  For normal app, this is not necesaary.
- TODO(b/140950043): Force crash if apps do not handle car service restart.
  But that will happen in longer term.

Bug: 140309761
Test: run unit test: atest android.car.CarTest,
      run kitchen sink and check API connection
      run MDTest app and make sure that new API works with normal app.

Change-Id: I5582e637cd3db0f57b0c61fae19ce0da29aea4b8
10 files changed
tree: 820016d98f239805ce5d02ef6218f4ee20e377b0
  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.