1## Custom Actions
2
3To add custom actions to the WebRTC control panel:
4
5*   Create a custom action config JSON file in your virtual device product
6    makefile directory.
7*   Create a `prebuilt_etc_host` module for the JSON file with `sub_dir`
8    `cvd_custom_action_config`
9*   Set the Soong config variable `custom_action_config` in the `cvd` namespace
10    to the name of that module. For example:
11
12    ```
13    Android.bp:
14      prebuilt_etc_host {
15          name: "my_custom_action_config.json",
16          src: "my_custom_action_config.json",
17          // The sub_dir must always equal the following value:
18          sub_dir: "cvd_custom_action_config",
19      }
20
21    my_virtual_device.mk:
22      $(call soong_config_set, cvd, custom_action_config, my_custom_action_config.json)
23    ```
24
25TODO(b/171709037): Add documentation to source.android.com
26
27See https://source.android.com/setup/create/cuttlefish-control-panel for
28detailed information about the format of the config file.
29
30## Custom CSS Style
31
32To apply a custom style to your device in the WebRTC control panel:
33
34*   Create a custom CSS file in your virtual device
35    product makefile directory.
36*   Create a `prebuilt_usr_share_host` module for the JSON file with `sub_dir`
37    `webrtc/assets` and `filename` `custom.css`
38*   Set the Soong config variable `custom_style` in the `cvd` namespace
39    to the name of that module. For example:
40
41    ```
42    Android.bp:
43      prebuilt_usr_share_host {
44          name: "my_custom_style.css",
45          src: "my_custom_style.css",
46          // the following values must be set to exactly this
47          filename: "custom.css",
48          sub_dir: "webrtc/assets",
49      }
50
51    my_virtual_device.mk:
52      # Set these variables exactly as shown here to enable the host package to see
53      # your custom config module name.
54      SOONG_CONFIG_NAMESPACES += cvd
55      SOONG_CONFIG_cvd += custom_style
56
57      # Set this value to the name of your JSON module.
58      SOONG_CONFIG_cvd_custom_style := my_custom_style.css
59
60    ```
61