1<!-- 2 Copyright (C) 2021 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License 15 --> 16 17# AAOS 18 19Source code for [Android Automotive OS](https://source.android.com/devices/automotive). 20 21## Structure 22 23``` 24car_product/ - AAOS product 25car-builtin-lib/ - A helper library for CarService to access hidden 26 framework APIs 27car-lib/ - Car API 28car-lib-module/ - Car API module 29cpp/ - Native services 30experimental/ - Experimental Car API and services 31packages/ - Apps and services for cars 32service/ - Car service module 33service-builint - Platform builtin component that runs CarService module 34tests/ - Tests and sample apps 35tools/ - Helper scripts 36``` 37 38## C++ 39 40Native (C++) code format is required to be compatible with .clang-format file. The formatter is 41already integrated to `repo` tool. To run manually, use: 42 43``` 44git clang-format --style=file --extension='h,cpp,cc' HEAD~ 45``` 46 47Note that clang-format is *not* desirable for Android java files. Therefore 48the command line above is limited to specific extensions. 49 50## Debugging CarService 51 52Dumpsys and car shell can be useful when debugging CarService integration issues. 53 54### dumpsys 55 56``` 57adb shell dumpsys car_service # to dump all car service information 58adb shell dumpsys car_service --services [service name] # to dump a specific service information 59adb shell dumpsys car_service --list # get list of available services 60``` 61 62Dumpsys for CarService includes the following (more information is availble in dumpsys, below are just highlights): 63- Enabled features 64- Current power policy and list of registered power policies 65- Power state of componens of power policy 66- Silent mode status 67- Garage mode status 68- I/O stats 69- List of available vehicle properties 70 71### car shell 72 73``` 74adb shell cmd car_service 75``` 76 77CarService supports commands via car shell:\ 78(list is not complete, run adb shell cmd car_service -h for more details) 79- Injection of vhal events 80- Toggling garage mode on/off 81- Toggling of suspend/hibernation/resume 82- Injection of input events 83- User managemnet/switching 84- Power policy control/manipulation 85 86### Helpful command for Garage mode 87 88Start Garage mode 89``` 90adb shell cmd car_service garage-mode on 91``` 92 93Finish Garage mode 94``` 95adb shell cmd car_service garage-mode on 96``` 97 98Get Garage mode status 99``` 100adb shell cmd car_service garage-mode query 101``` 102 103Change Garage mode max duration (only eng and debug builds) 104``` 105adb shell setprop android.car.garagemodeduration <seconds> 106```