• Home
Name Date Size #Lines LOC

..--

car-rotary-lib/03-May-2024-5,6233,738

car-ui-androidx/03-May-2024-3,6023,524

car-ui-lib/03-May-2024-42,67126,237

documentation/images/03-May-2024-

oem-apis/03-May-2024-1,850626

paintbooth/03-May-2024-5,2903,452

referencedesign/03-May-2024-7,9975,465

tests/03-May-2024-1,5211,102

.gitignoreD03-May-2024265 2216

Android.bpD03-May-20243.6 KiB138122

Android.mkD03-May-20241.2 KiB405

AndroidTest.xmlD03-May-20242.2 KiB4514

OWNERSD03-May-2024180 129

README.mdD03-May-20244.9 KiB7946

TEST_MAPPINGD03-May-202477 87

build.gradleD03-May-20241.5 KiB4841

findviewbyid-preupload-hook.shD03-May-2024399 84

generate_rros.mkD03-May-20242 KiB6433

gradle.propertiesD03-May-20241.6 KiB3433

gradlewD03-May-20245.6 KiB186125

gradlew.batD03-May-20243 KiB10578

settings.gradleD03-May-20241 KiB2825

trailing-blank-line-hook.shD03-May-2024351 85

README.md

1# Android Automotive 'Chassis' library
2Components and resources designed to increase Automotive UI consistency between
3GAS (Google Automotive Services) apps, system-apps and OEM developed apps.
4
5See: go/aae-chassis-site
6
7## Content
8
9Components and resources designed to be configured by means of RRO (Runtime
10Resource Overlays) by OEMs.
11
12## Developing
13
14Project layout:
15* __car-ui-lib__: The main library that is statically linked into applications
16* __paintbooth__: A test application that contains demos of all the car-ui components
17* __referencedesign__: An RRO applied to internal google targets that does some minor car-ui customizations. It's used to make changes to car-ui that would cause backwards compatability issues if we were to create them directly in the library. It can also serve as an example RRO for OEMs, and should be kept reasonably functional and up-to-date because we use it actively.
18
19### Building and running PaintBooth
20
21While car-ui-lib can be developed by using aidegen, it's probably easier to use Android Studio with the gradle build files. To do this, select "Open an existing Android Studio project", then navigating to the (outer) car-ui-lib folder:
22
23![Open an existing Android Studio project](documentation/images/open_existing_android_studio_project.png)
24![Navigating to car-ui-lib](documentation/images/navigating_to_car_ui_lib.png)
25
26If this is your first time using Android Studio, it may ask you to install an SDK. Go ahead and do that.
27
28It may ask if you want to generate the gradle wrapper files, select "Yes". Wait for it to finish indexing, and then you should see car-ui-lib and PaintBooth projects in the project pane on the left. Make sure your project view is set to "Android" mode, as opposed to the regular "Project" mode:
29
30![Android project view](documentation/images/android_project_view.png)
31
32To launch paintbooth, start a car emulator or connect a device, make sure the PaintBooth module and "Virtual Device" is selected in your Android Studio toolbar, then click the green arrow:
33
34![Launching Paintbooth](documentation/images/launch_paintbooth.png)
35
36If it launches a LeakCanary activity instead of PaintBooth, either exit LeakCanary and launch PaintBooth as normal through the car's launcher, or click on the PaintBooth module > Edit configurations > Change "Launch: Default Activity" to "Specified Activity", and enter `com.android.car.ui.paintbooth.MainActivity`.
37
38### Building and running the shared library
39
40Setting up the shared library is mostly the same as setting up paintbooth. However, when you attempt to install the shared library, Android Studio will complain it can't launch any activity (despite the installation succeeding), and your changes won't properly show up. To fix these issues, edit the shared library configuration, change the "Launch:" option to launch nothing, and check the "Always install with package manager (disables deployment optimizations on Android 11 and higher)" button. This checkbox shouldn't be required after b/188220380 is fixed.
41
42![Shared library setup](documentation/images/shared_library_setup.png)
43
44### Running tests
45
46Once you've set up paintbooth as described above, just open one of the test classes in car-ui-lib > java > com.android.car.ui (androidTest) and click the green arrow next to one of the tests to run it:
47
48![Running tests](documentation/images/running_tests.png)
49
50The tests can also be run from the command line via `atest CarUILibUnitTests`, but that's much slower than running them through Android Studio.
51
52### Getting coverage reports
53
54Coverage reports must be generated from the command line as opposed to Android Studio. Run `./gradlew createDebugCoverageReport` to generate a coverate report under `packages/apps/Car/libs/car-ui-lib/car-ui-lib/build/reports/coverage/debug/index.html`. Currently, you must first run `adb shell am switch-user 0` due to b/183903243
55
56To only run certain tests, run `./gradlew clean createDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.tests_regex=CarUiIme*`, changing the regex as necessary.
57
58## Updating Google3
59
60This library is developed in Gerrit and copied as source to Google3 using
61Copybara (go/copybara).
62
63Source: /packages/apps/Car/libs/car-ui-lib
64Target: //google3/third_party/java/android_libs/android_car_chassis_lib
65
66Here is the process for updating this library:
67
681. Develop, test and upload changes to Gerrit
692. On Google3, run `./update.sh review <cl>` (with <cl> being your Gerrit CL #) and test your changes
703. Repeat #1 and #2 until your changes look okay on both places.
714. Back on Gerrit, submit your CL.
725. Back on Google3, run `./update.sh manual` submit
73
74TODO: Automate this process using CaaS (in progress)
75
76If you're just updating the current state of car-ui-lib, and not testing a review that has yet to be submitted, the process can be simplified to:
77
78`/google/data/ro/teams/copybara/copybara /google/src/head/depot/google3/third_party/java_src/android_libs/car_chassis_lib/copy.bara.sky default`
79