Allow bugreport app to gracefully handle errors.

1. Increase timeout when reading from dumpstate socket in main.cpp.
   EAGAIN on line main.cpp:107 means socket has no data to read, we
   should try reading again. Many code I've seen infinitely retries.
   adb-bugreport tool waits 10 minutes, see
   frameworks/native/cmds/bugreportz/main.cpp.
2. Start reading from dumpstate socket only if progress returned
   success, otherwise it just fails - main.cpp:230.
3. Enable logging MediaRecorder events - BugReportActivity:387.
4. Allow gracefully handling media recorder stop errors.
   BugReportActivity:415.
5. Allow skipping empty files when adding to the final zip.
   BugReportService:491.

Change-Id: Ic1a82fe28ab261ac9bc58477e79ff7819958b63b
Bug: 140430647
Test: on a hawk rig (both success and simulated error case)
3 files changed
tree: b14dc922dade7cfe339532f7e579280fb0cf4e8c
  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.