README.md
1# AAE BugReport App
2
3A test tool that is intended to show how to access Android Automotive OS bugreporting APIs.
4It stores all bugreports in user 0 context and then allows uploading them to GCS.
5
6## Flow
7
81. User long presses Notification icon
92. It opens BugReportActivity as dialog under current user (e.g. u10)
103. BugReportActivity connects to BugReportService and checks if a bugreporting is running.
114. If bugreporting is already running it shows in progress dialog
125. Otherwise it creates MetaBugReport record in a local db and starts recording audio message.
136. When the submit button is clicked, it saves the audio message in temp directory and starts
14 BugReportService.
157. If the drivers cancels the dialog, the BugReportActivity deletes temp directory and closes the
16 activity.
178. BugReportService running under current user (e.g. u10) starts collecting logs using dumpstate,
18 and when finished it updates MetaBugReport using BugStorageProvider.
199. BugStorageProvider is running under u0, it schedules UploadJob.
2010. UploadJob runs SimpleUploaderAsyncTask to upload the bugreport.
21
22Bug reports are zipped and uploaded to GCS. GCS enables creating Pub/Sub
23notifications that can be used to track when new bug reports are uploaded.
24
25## System configuration
26
27BugReport app uses `CarBugreportServiceManager` to collect bug reports and
28screenshots. `CarBugreportServiceManager` allows only one bug report app to
29use it's APIs, by default it's none.
30
31To allow AAE BugReport app to access the API, you need to overlay
32`config_car_bugreport_application` in `packages/services/Car/service/res/values/config.xml`
33with value `com.google.android.car.bugreport`.
34
35## App Configuration
36
37UI and upload configs are located in `res/` directory. Resources can be
38[overlayed](https://source.android.com/setup/develop/new-device#use-resource-overlays)
39for specific products.
40
41### System Properties
42
43- `android.car.bugreport.disableautoupload` - set it to `true` to disable auto-upload to Google
44 Cloud, and allow users to manually upload or copy the bugreports to flash drive.
45
46### Upload configuration
47
48BugReport app uses `res/raw/gcs_credentials.json` for authentication and
49`res/values/configs.xml` for obtaining GCS bucket name.
50
51## Testing
52
53### Manually testing the app using the test script
54
55BugReportApp comes with `utils/bugreport_app_tester.py` script that automates
56many of the BugReportApp testing process. Please follow these instructions
57to test the app:
58
591. Connect the device to your computer.
602. Make sure the device has Internet.
613. Run the script: `$ python bugreport_app_tester.py`
62 * The script works on python 2.7 and above.
63 * If multiple devices connected, see the usage
64 `$ python bugreport_app_tester.py --help`.
65 * Warning: the script will delete all the bug reports on the device.
664. Script might take up to 10 minutes to finish.
67 * It might fail to upload bugreport when time/time-zone is invalid.
68 * In rare cases it might not upload the bugreport, depending Android's
69 task scheduling rules.
705. Please manually verify the script's results.
716. Please manually verify bug report contents.
72 * Images - the should contain screenshots of all the physical displays.
73 * Audio files - they should contain the audio message you recorded.
74 * Dumpstate (bugreport) - it should contain logs and other information.
75