Add a shell command to power off car

- This CL introduces "power-off" command which makes the car powered
off.
- The final state can be "suspend" or "shutdown". To make it shutdown,
"--shutdown" option needs to be given.
- Also, it is possible to skip Garage Mode by giving "--skip-garagemode".
- If the vehicle doesn't support S2R, the car will be shutdown even if
the command is "suspend".

Bug: 175757530
Bug: 175337240
Test: run "cmd car_service power-off --skip-garagemode" and make
sure that the device suspends.

Change-Id: I81489d7941da56ba0a44df26c9d9dff2fead4a5f
Merged-In: I81489d7941da56ba0a44df26c9d9dff2fead4a5f
(cherry picked from commit e701e0d568184721126b5a991974753f765f2ae4)
2 files changed
tree: 24e8ed0411d77ec60c7a65b534506f0939cbda56
  1. car-bugreportd/
  2. car-default-input-service/
  3. car-internal-lib/
  4. car-lib/
  5. car-maps-placeholder/
  6. car-systemtest-lib/
  7. car-test-lib/
  8. car-usb-handler/
  9. car_product/
  10. computepipe/
  11. cpp/
  12. EncryptionRunner/
  13. evs/
  14. experimental/
  15. FrameworkPackageStubs/
  16. obd2-lib/
  17. packages/
  18. procfs-inspector/
  19. service/
  20. tests/
  21. tools/
  22. user/
  23. vehicle-hal-support-lib/
  24. watchdog/
  25. .clang-format
  26. .gitignore
  27. Android.mk
  28. CleanSpec.mk
  29. CPPLINT.cfg
  30. OWNERS
  31. PREUPLOAD.cfg
  32. README.md
  33. TEST_MAPPING
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.