Allow settings a freeform string restriction mode

Allow OEMs to create any restriction mode they want, as identified
by its string. Previously we were hard-coding integer values, such
as passenger mode. We realized this wasn't going to be scalable as
OEMs started requesting modes for "teen" and different autonomy
levels. This change is backward-compatible with the existing XML
config.

- Change APIs from using hard-coded IntDefs to Strings
- XML configuration is the same, but parsing logic needs to change
- Use a new JSON format to make it more readable and still efficient
- Backward compatible with original schema

Bug: 147762570
Test: atest CarServiceTest && atest AndroidCarApiTest
Change-Id: Id97512f351ef12b65b42285540a51b295a257a43
12 files changed
tree: 8b98a4fdb798e6a6e716111bf53f9ff84b487fda
  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. tests/
  18. tools/
  19. user/
  20. vehicle-hal-support-lib/
  21. watchdog/
  22. .clang-format
  23. .gitignore
  24. Android.mk
  25. CleanSpec.mk
  26. OWNERS
  27. PREUPLOAD.cfg
  28. 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.