Force car service crash handling to client

- If client handles car service crash by using ServiceConnection or
  CarServiceLifecycleListener, client is left alive.

- If client does not handle it, crash the client when car service crashes. This
  was partially done before by throwing RuntimeException for failed binder calls
  or some **wrong** disconnection handling in Car*Managers but it will crash
  relabily in service connection handler instead.

- All binder call failure will no longer return RuntimeException as service
  connection handler will crash the client or client should re-do initialization
  anyway.

- Refactored CarManagerBase to provide common utilities so that exception
  handling can be done in a single place.

- Client should throw away all old Car*Manager and does not need to make any
  cleanup call for old objects. Old Car*Manager objects should clean things up
  by itself.

- Car*Manager clean all listeners / callbacks passed from client so that those
  are not potentially leaked.

Bug: 142543455
Bug: 142541056

Test: kill car service and check if clients using non-handling clients are
      crashed and handling clients are not crashing. Kitchensink carapi page
      can be used for this.
      Runs all automated tests (car api, unit, car service test).

Change-Id: Id515a42041fb7000d2bcd48af9931b33dc1f9fdd
42 files changed
tree: 7b2eb45ad63f353d6899a96ca69a0fad0a2b74ca
  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.