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).

Merged-In: Id515a42041fb7000d2bcd48af9931b33dc1f9fdd
Change-Id: Id515a42041fb7000d2bcd48af9931b33dc1f9fdd
38 files changed
tree: 5b498d368c1603ccbc1d72819ed5a8928d4c88ef
  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. EncryptionRunner/
  10. evs/
  11. FrameworkPackageStubs/
  12. obd2-lib/
  13. procfs-inspector/
  14. service/
  15. tests/
  16. tools/
  17. user/
  18. vehicle-hal-support-lib/
  19. .clang-format
  20. .gitignore
  21. Android.mk
  22. CleanSpec.mk
  23. OWNERS
  24. PREUPLOAD.cfg
  25. 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.