1 // 2 // Copyright (C) 2019 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 #pragma once 17 18 #include <optional> 19 #include <string> 20 #include <vector> 21 22 #include <fruit/fruit.h> 23 24 #include "host/commands/run_cvd/launch/grpc_socket_creator.h" 25 #include "host/commands/run_cvd/launch/input_connections_provider.h" 26 #include "host/commands/run_cvd/launch/log_tee_creator.h" 27 #include "host/commands/run_cvd/launch/sensors_socket_pair.h" 28 #include "host/commands/run_cvd/launch/snapshot_control_files.h" 29 #include "host/commands/run_cvd/launch/webrtc_controller.h" 30 #include "host/commands/run_cvd/launch/wmediumd_server.h" 31 #include "host/libs/config/command_source.h" 32 #include "host/libs/config/custom_actions.h" 33 #include "host/libs/config/cuttlefish_config.h" 34 #include "host/libs/config/feature.h" 35 #include "host/libs/config/kernel_log_pipe_provider.h" 36 37 namespace cuttlefish { 38 39 Result<std::optional<MonitorCommand>> UwbConnector( 40 const CuttlefishConfig&, const CuttlefishConfig::InstanceSpecific&); 41 42 std::optional<MonitorCommand> AutomotiveProxyService(const CuttlefishConfig&); 43 44 fruit::Component<fruit::Required<const CuttlefishConfig, LogTeeCreator, 45 const CuttlefishConfig::InstanceSpecific>> 46 VhostDeviceVsockComponent(); 47 48 Result<std::optional<MonitorCommand>> BluetoothConnector( 49 const CuttlefishConfig&, const CuttlefishConfig::InstanceSpecific&); 50 51 Result<MonitorCommand> NfcConnector( 52 const CuttlefishConfig::EnvironmentSpecific&, 53 const CuttlefishConfig::InstanceSpecific&); 54 55 fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific>, 56 KernelLogPipeProvider> 57 KernelLogMonitorComponent(); 58 59 Result<MonitorCommand> LogcatReceiver( 60 const CuttlefishConfig::InstanceSpecific&); 61 std::string LogcatInfo(const CuttlefishConfig::InstanceSpecific&); 62 63 Result<std::optional<MonitorCommand>> CasimirControlServer( 64 const CuttlefishConfig&, const CuttlefishConfig::EnvironmentSpecific&, 65 const CuttlefishConfig::InstanceSpecific&, GrpcSocketCreator&); 66 67 Result<std::optional<MonitorCommand>> ConsoleForwarder( 68 const CuttlefishConfig::InstanceSpecific&); 69 std::string ConsoleInfo(const CuttlefishConfig::InstanceSpecific&); 70 71 fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific, 72 GrpcSocketCreator>> 73 ControlEnvProxyServerComponent(); 74 75 Result<std::optional<MonitorCommand>> GnssGrpcProxyServer( 76 const CuttlefishConfig::InstanceSpecific&, GrpcSocketCreator&); 77 78 std::optional<MonitorCommand> MetricsService(const CuttlefishConfig&); 79 80 fruit::Component<fruit::Required< 81 const CuttlefishConfig, const CuttlefishConfig::EnvironmentSpecific, 82 const CuttlefishConfig::InstanceSpecific, LogTeeCreator, WmediumdServer>> 83 OpenWrtComponent(); 84 85 fruit::Component<fruit::Required<const CuttlefishConfig, 86 const CuttlefishConfig::EnvironmentSpecific, 87 GrpcSocketCreator>> 88 OpenwrtControlServerComponent(); 89 90 fruit::Component< 91 fruit::Required<const CuttlefishConfig, 92 const CuttlefishConfig::InstanceSpecific, LogTeeCreator>> 93 RootCanalComponent(); 94 95 Result<std::vector<MonitorCommand>> Casimir( 96 const CuttlefishConfig&, const CuttlefishConfig::EnvironmentSpecific&, 97 const CuttlefishConfig::InstanceSpecific&, LogTeeCreator&); 98 99 Result<std::vector<MonitorCommand>> Pica( 100 const CuttlefishConfig&, const CuttlefishConfig::InstanceSpecific&, 101 LogTeeCreator&); 102 103 MonitorCommand EchoServer(GrpcSocketCreator& grpc_socket); 104 105 fruit::Component<fruit::Required<const CuttlefishConfig, 106 const CuttlefishConfig::InstanceSpecific>> 107 NetsimServerComponent(); 108 109 Result<std::optional<MonitorCommand>> ScreenRecordingServer(GrpcSocketCreator&); 110 111 Result<MonitorCommand> SecureEnv(const CuttlefishConfig&, 112 const CuttlefishConfig::InstanceSpecific&, 113 AutoSnapshotControlFiles::Type&, 114 KernelLogPipeProvider&); 115 116 Result<MonitorCommand> TombstoneReceiver( 117 const CuttlefishConfig::InstanceSpecific&); 118 119 fruit::Component<fruit::Required< 120 const CuttlefishConfig, const CuttlefishConfig::EnvironmentSpecific, 121 const CuttlefishConfig::InstanceSpecific, LogTeeCreator, GrpcSocketCreator>> 122 WmediumdServerComponent(); 123 124 Result<std::optional<MonitorCommand>> ModemSimulator( 125 const CuttlefishConfig::InstanceSpecific&); 126 127 fruit::Component<fruit::Required< 128 const CuttlefishConfig, KernelLogPipeProvider, InputConnectionsProvider, 129 const CuttlefishConfig::InstanceSpecific, const CustomActionConfigProvider, 130 WebRtcController>> 131 launchStreamerComponent(); 132 133 fruit::Component<WebRtcController> WebRtcControllerComponent(); 134 135 fruit::Component< 136 fruit::Required<const CuttlefishConfig, 137 const CuttlefishConfig::InstanceSpecific, LogTeeCreator>> 138 McuComponent(); 139 140 fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific>, 141 InputConnectionsProvider, LogTeeCreator> 142 VhostInputDevicesComponent(); 143 144 std::optional<MonitorCommand> VhalProxyServer( 145 const CuttlefishConfig&, const CuttlefishConfig::InstanceSpecific&); 146 147 fruit::Component<fruit::Required<const CuttlefishConfig, LogTeeCreator, 148 const CuttlefishConfig::InstanceSpecific>> 149 Ti50EmulatorComponent(); 150 151 Result<MonitorCommand> SensorsSimulator( 152 const CuttlefishConfig::InstanceSpecific&, 153 AutoSensorsSocketPair::Type& sensors_socket_pair); 154 } // namespace cuttlefish 155