• Home
  • Raw
  • Download

Lines Matching refs:config

41 std::string GetAdbConnectorVsockArg(const vsoc::CuttlefishConfig& config) {  in GetAdbConnectorVsockArg()  argument
43 + std::to_string(config.vsock_guest_cid()) in GetAdbConnectorVsockArg()
47 bool AdbModeEnabled(const vsoc::CuttlefishConfig& config, const char* mode) { in AdbModeEnabled() argument
48 return config.adb_mode().count(mode) > 0; in AdbModeEnabled()
51 bool AdbTunnelEnabled(const vsoc::CuttlefishConfig& config) { in AdbTunnelEnabled() argument
52 return AdbModeEnabled(config, kAdbModeTunnel); in AdbTunnelEnabled()
55 bool AdbVsockTunnelEnabled(const vsoc::CuttlefishConfig& config) { in AdbVsockTunnelEnabled() argument
56 return config.vsock_guest_cid() > 2 in AdbVsockTunnelEnabled()
57 && AdbModeEnabled(config, kAdbModeVsockTunnel); in AdbVsockTunnelEnabled()
60 bool AdbVsockHalfTunnelEnabled(const vsoc::CuttlefishConfig& config) { in AdbVsockHalfTunnelEnabled() argument
61 return config.vsock_guest_cid() > 2 in AdbVsockHalfTunnelEnabled()
62 && AdbModeEnabled(config, kAdbModeVsockHalfTunnel); in AdbVsockHalfTunnelEnabled()
65 bool AdbTcpConnectorEnabled(const vsoc::CuttlefishConfig& config) { in AdbTcpConnectorEnabled() argument
66 bool tunnel = AdbTunnelEnabled(config); in AdbTcpConnectorEnabled()
67 bool vsock_tunnel = AdbVsockTunnelEnabled(config); in AdbTcpConnectorEnabled()
68 bool vsock_half_tunnel = AdbVsockHalfTunnelEnabled(config); in AdbTcpConnectorEnabled()
69 return config.run_adb_connector() in AdbTcpConnectorEnabled()
73 bool AdbVsockConnectorEnabled(const vsoc::CuttlefishConfig& config) { in AdbVsockConnectorEnabled() argument
74 return config.run_adb_connector() in AdbVsockConnectorEnabled()
75 && AdbModeEnabled(config, kAdbModeNativeVsock); in AdbVsockConnectorEnabled()
79 const vsoc::CuttlefishConfig& config) { in GetOnSubprocessExitCallback() argument
80 if (config.restart_subprocesses()) { in GetOnSubprocessExitCallback()
93 bool LogcatReceiverEnabled(const vsoc::CuttlefishConfig& config) { in LogcatReceiverEnabled() argument
94 return config.logcat_mode() == cvd::kLogcatVsockMode; in LogcatReceiverEnabled()
97 bool AdbUsbEnabled(const vsoc::CuttlefishConfig& config) { in AdbUsbEnabled() argument
98 return AdbModeEnabled(config, kAdbModeUsb); in AdbUsbEnabled()
101 void ValidateAdbModeFlag(const vsoc::CuttlefishConfig& config) { in ValidateAdbModeFlag() argument
102 if (!AdbUsbEnabled(config) && !AdbTunnelEnabled(config) in ValidateAdbModeFlag()
103 && !AdbVsockTunnelEnabled(config) && !AdbVsockHalfTunnelEnabled(config)) { in ValidateAdbModeFlag()
108 cvd::Command GetIvServerCommand(const vsoc::CuttlefishConfig& config) { in GetIvServerCommand() argument
110 auto actual_width = cvd::AlignToPowerOf2(config.x_res() * 4, 4);// align to 16 in GetIvServerCommand()
112 config.num_screen_buffers() * in GetIvServerCommand()
113 cvd::AlignToPageSize(actual_width * config.y_res() + 16 /* padding */); in GetIvServerCommand()
115 (config.num_screen_buffers() - 1) * 4096; /* Guard pages */ in GetIvServerCommand()
120 config.mempath(), in GetIvServerCommand()
124 cvd::Command ivserver(config.ivserver_binary()); in GetIvServerCommand()
127 CreateIvServerUnixSocket(config.ivshmem_qemu_socket_path())); in GetIvServerCommand()
130 CreateIvServerUnixSocket(config.ivshmem_client_socket_path())); in GetIvServerCommand()
137 cvd::Command GetKernelLogMonitorCommand(const vsoc::CuttlefishConfig& config, in GetKernelLogMonitorCommand() argument
140 auto log_name = config.kernel_log_socket_name(); in GetKernelLogMonitorCommand()
143 cvd::Command kernel_log_monitor(config.kernel_log_monitor_binary()); in GetKernelLogMonitorCommand()
162 void LaunchLogcatReceiverIfEnabled(const vsoc::CuttlefishConfig& config, in LaunchLogcatReceiverIfEnabled() argument
164 if (!LogcatReceiverEnabled(config)) { in LaunchLogcatReceiverIfEnabled()
167 auto port = config.logcat_vsock_port(); in LaunchLogcatReceiverIfEnabled()
174 cvd::Command cmd(config.logcat_receiver_binary()); in LaunchLogcatReceiverIfEnabled()
177 GetOnSubprocessExitCallback(config)); in LaunchLogcatReceiverIfEnabled()
180 void LaunchUsbServerIfEnabled(const vsoc::CuttlefishConfig& config, in LaunchUsbServerIfEnabled() argument
182 if (!AdbUsbEnabled(config)) { in LaunchUsbServerIfEnabled()
185 auto socket_name = config.usb_v1_socket_name(); in LaunchUsbServerIfEnabled()
193 cvd::Command usb_server(config.virtual_usb_manager_binary()); in LaunchUsbServerIfEnabled()
196 GetOnSubprocessExitCallback(config)); in LaunchUsbServerIfEnabled()
209 void LaunchVNCServerIfEnabled(const vsoc::CuttlefishConfig& config, in LaunchVNCServerIfEnabled() argument
212 if (config.enable_vnc_server()) { in LaunchVNCServerIfEnabled()
214 auto port_options = "-port=" + std::to_string(config.vnc_server_port()); in LaunchVNCServerIfEnabled()
215 cvd::Command vnc_server(config.vnc_server_binary()); in LaunchVNCServerIfEnabled()
217 if (!config.enable_ivserver()) { in LaunchVNCServerIfEnabled()
221 auto touch_server = CreateVncInputServer(config.touch_socket_path()); in LaunchVNCServerIfEnabled()
228 CreateVncInputServer(config.keyboard_socket_path()); in LaunchVNCServerIfEnabled()
238 cvd::SharedFD::VsockServer(config.frames_vsock_port(), SOCK_STREAM); in LaunchVNCServerIfEnabled()
248 void LaunchStreamAudioIfEnabled(const vsoc::CuttlefishConfig& config, in LaunchStreamAudioIfEnabled() argument
251 if (config.enable_stream_audio()) { in LaunchStreamAudioIfEnabled()
252 auto port_options = "-port=" + std::to_string(config.stream_audio_port()); in LaunchStreamAudioIfEnabled()
253 cvd::Command stream_audio(config.stream_audio_binary()); in LaunchStreamAudioIfEnabled()
260 const vsoc::CuttlefishConfig& config, in LaunchAdbConnectorIfEnabled() argument
263 cvd::Command adb_connector(config.adb_connector_binary()); in LaunchAdbConnectorIfEnabled()
266 if (AdbTcpConnectorEnabled(config)) { in LaunchAdbConnectorIfEnabled()
270 if (AdbVsockConnectorEnabled(config)) { in LaunchAdbConnectorIfEnabled()
272 adb_connector.AddParameter(GetAdbConnectorVsockArg(config)); in LaunchAdbConnectorIfEnabled()
277 GetOnSubprocessExitCallback(config)); in LaunchAdbConnectorIfEnabled()
282 const vsoc::CuttlefishConfig& config) { in LaunchSocketForwardProxyIfEnabled() argument
283 if (AdbTunnelEnabled(config)) { in LaunchSocketForwardProxyIfEnabled()
284 cvd::Command adb_tunnel(config.socket_forward_proxy_binary()); in LaunchSocketForwardProxyIfEnabled()
288 GetOnSubprocessExitCallback(config)); in LaunchSocketForwardProxyIfEnabled()
293 const vsoc::CuttlefishConfig& config) { in LaunchSocketVsockProxyIfEnabled() argument
294 if (AdbVsockTunnelEnabled(config)) { in LaunchSocketVsockProxyIfEnabled()
295 cvd::Command adb_tunnel(config.socket_vsock_proxy_binary()); in LaunchSocketVsockProxyIfEnabled()
300 std::to_string(config.vsock_guest_cid())); in LaunchSocketVsockProxyIfEnabled()
302 GetOnSubprocessExitCallback(config)); in LaunchSocketVsockProxyIfEnabled()
304 if (AdbVsockHalfTunnelEnabled(config)) { in LaunchSocketVsockProxyIfEnabled()
305 cvd::Command adb_tunnel(config.socket_vsock_proxy_binary()); in LaunchSocketVsockProxyIfEnabled()
310 std::to_string(config.vsock_guest_cid())); in LaunchSocketVsockProxyIfEnabled()
312 GetOnSubprocessExitCallback(config)); in LaunchSocketVsockProxyIfEnabled()
317 const vsoc::CuttlefishConfig& config) { in LaunchIvServerIfEnabled() argument
318 if (config.enable_ivserver()) { in LaunchIvServerIfEnabled()
319 process_monitor->StartSubprocess(GetIvServerCommand(config), in LaunchIvServerIfEnabled()
320 GetOnSubprocessExitCallback(config)); in LaunchIvServerIfEnabled()
323 PreLaunchInitializers::Initialize(config); in LaunchIvServerIfEnabled()