Android-cuttlefish cvd tool
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cuttlefish::ConnectionObserverImpl Class Reference
Inheritance diagram for cuttlefish::ConnectionObserverImpl:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::ConnectionObserverImpl:
Collaboration graph
[legend]

Public Member Functions

 ConnectionObserverImpl (std::unique_ptr< InputConnector::EventSink > input_events_sink, KernelLogEventsHandler &kernel_log_events_handler, std::map< std::string, SharedFD > commands_to_custom_action_servers, std::weak_ptr< DisplayHandler > display_handler, CameraController *camera_controller, webrtc_streaming::SensorsHandler &sensors_handler, std::shared_ptr< webrtc_streaming::LightsObserver > lights_observer)
 
virtual ~ConnectionObserverImpl ()
 
void OnConnected () override
 
Result< void > OnMouseMoveEvent (int x, int y) override
 
Result< void > OnMouseButtonEvent (int button, bool down) override
 
Result< void > OnMouseWheelEvent (int pixels) override
 
Result< void > OnGamepadKeyEvent (int button, bool down) override
 
Result< void > OnGamepadMotionEvent (int code, int value) override
 
Result< void > OnTouchEvent (const std::string &device_label, int x, int y, bool down) override
 
Result< void > OnMultiTouchEvent (const std::string &device_label, Json::Value id, Json::Value x, Json::Value y, bool down, int size) override
 
Result< void > OnKeyboardEvent (uint16_t code, bool down) override
 
Result< void > OnRotaryWheelEvent (int pixels) override
 
Result< void > OnSwitchEvent (uint16_t code, bool state)
 
void OnAdbChannelOpen (std::function< bool(const uint8_t *, size_t)> adb_message_sender) override
 
void OnAdbMessage (const uint8_t *msg, size_t size) override
 
void OnControlChannelOpen (std::function< bool(const Json::Value)> control_message_sender) override
 
Result< void > OnLidStateChange (bool lid_open) override
 
void OnHingeAngleChange (int) override
 
Result< void > OnPowerButton (bool button_down) override
 
Result< void > OnBackButton (bool button_down) override
 
Result< void > OnHomeButton (bool button_down) override
 
Result< void > OnMenuButton (bool button_down) override
 
Result< void > OnVolumeDownButton (bool button_down) override
 
Result< void > OnVolumeUpButton (bool button_down) override
 
void OnCustomActionButton (const std::string &command, const std::string &button_state) override
 
void OnBluetoothChannelOpen (std::function< bool(const uint8_t *, size_t)> bluetooth_message_sender) override
 
void OnBluetoothMessage (const uint8_t *msg, size_t size) override
 
void OnSensorsChannelOpen (std::function< bool(const uint8_t *, size_t)> sensors_message_sender) override
 
void OnSensorsChannelClosed () override
 
void OnSensorsMessage (const uint8_t *msg, size_t size) override
 
void OnLightsChannelOpen (std::function< bool(const Json::Value &)> lights_message_sender) override
 
void OnLightsChannelClosed () override
 
void OnLocationChannelOpen (std::function< bool(const uint8_t *, size_t)> location_message_sender) override
 
void OnLocationMessage (const uint8_t *msg, size_t size) override
 
void OnKmlLocationsChannelOpen (std::function< bool(const uint8_t *, size_t)> kml_locations_message_sender) override
 
void OnKmlLocationsMessage (const uint8_t *msg, size_t size) override
 
void OnGpxLocationsChannelOpen (std::function< bool(const uint8_t *, size_t)> gpx_locations_message_sender) override
 
void OnGpxLocationsMessage (const uint8_t *msg, size_t size) override
 
void OnCameraControlMsg (const Json::Value &msg) override
 
void OnDisplayControlMsg (const Json::Value &msg) override
 
void OnDisplayAddMsg (const Json::Value &msg) override
 
Result< void > HandleDisplayAddMessage (const Json::Value &msg)
 
void OnDisplayRemoveMsg (const Json::Value &msg) override
 
Result< void > HandleDisplayRemoveMessage (const Json::Value &msg)
 
void OnCameraData (const std::vector< char > &data) override
 
- Public Member Functions inherited from cuttlefish::webrtc_streaming::ConnectionObserver
 ConnectionObserver ()=default
 
virtual ~ConnectionObserver ()=default
 
virtual void OnConnected ()=0
 
virtual Result< void > OnMouseMoveEvent (int x, int y)=0
 
virtual Result< void > OnMouseButtonEvent (int button, bool down)=0
 
virtual Result< void > OnMouseWheelEvent (int pixels)=0
 
virtual Result< void > OnGamepadKeyEvent (int button, bool down)=0
 
virtual Result< void > OnGamepadMotionEvent (int code, int value)=0
 
virtual Result< void > OnTouchEvent (const std::string &device_label, int x, int y, bool down)=0
 
virtual Result< void > OnMultiTouchEvent (const std::string &label, Json::Value id, Json::Value x, Json::Value y, bool down, int size)=0
 
virtual Result< void > OnKeyboardEvent (uint16_t keycode, bool down)=0
 
virtual Result< void > OnRotaryWheelEvent (int pixels)=0
 
virtual void OnAdbChannelOpen (std::function< bool(const uint8_t *, size_t)> adb_message_sender)=0
 
virtual void OnAdbMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnControlChannelOpen (std::function< bool(const Json::Value)> control_message_sender)=0
 
virtual Result< void > OnLidStateChange (bool lid_open)=0
 
virtual void OnHingeAngleChange (int hinge_angle)=0
 
virtual Result< void > OnPowerButton (bool button_down)=0
 
virtual Result< void > OnBackButton (bool button_down)=0
 
virtual Result< void > OnHomeButton (bool button_down)=0
 
virtual Result< void > OnMenuButton (bool button_down)=0
 
virtual Result< void > OnVolumeDownButton (bool button_down)=0
 
virtual Result< void > OnVolumeUpButton (bool button_down)=0
 
virtual void OnCustomActionButton (const std::string &command, const std::string &button_state)=0
 
virtual void OnCameraControlMsg (const Json::Value &msg)=0
 
virtual void OnDisplayControlMsg (const Json::Value &msg)=0
 
virtual void OnDisplayAddMsg (const Json::Value &msg)=0
 
virtual void OnDisplayRemoveMsg (const Json::Value &msg)=0
 
virtual void OnBluetoothChannelOpen (std::function< bool(const uint8_t *, size_t)> bluetooth_message_sender)=0
 
virtual void OnBluetoothMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnSensorsChannelOpen (std::function< bool(const uint8_t *, size_t)> sensors_message_sender)=0
 
virtual void OnSensorsMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnSensorsChannelClosed ()=0
 
virtual void OnLightsChannelOpen (std::function< bool(const Json::Value &)> lights_message_sender)=0
 
virtual void OnLightsChannelClosed ()=0
 
virtual void OnLocationChannelOpen (std::function< bool(const uint8_t *, size_t)> location_message_sender)=0
 
virtual void OnLocationMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnKmlLocationsChannelOpen (std::function< bool(const uint8_t *, size_t)> kml_locations_message_sender)=0
 
virtual void OnGpxLocationsChannelOpen (std::function< bool(const uint8_t *, size_t)> gpx_locations_message_sender)=0
 
virtual void OnKmlLocationsMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnGpxLocationsMessage (const uint8_t *msg, size_t size)=0
 
virtual void OnCameraData (const std::vector< char > &data)=0
 

Private Member Functions

void SendLastFrameAsync (std::optional< uint32_t > display_number)
 

Private Attributes

std::unique_ptr< InputConnector::EventSinkinput_events_sink_
 
KernelLogEventsHandlerkernel_log_events_handler_
 
int kernel_log_subscription_id_ = -1
 
std::shared_ptr< webrtc_streaming::AdbHandleradb_handler_
 
std::shared_ptr< webrtc_streaming::BluetoothHandlerbluetooth_handler_
 
std::shared_ptr< webrtc_streaming::LocationHandlerlocation_handler_
 
std::shared_ptr< webrtc_streaming::KmlLocationsHandlerkml_locations_handler_
 
std::shared_ptr< webrtc_streaming::GpxLocationsHandlergpx_locations_handler_
 
std::map< std::string, SharedFDcommands_to_custom_action_servers_
 
std::weak_ptr< DisplayHandlerweak_display_handler_
 
CameraControllercamera_controller_
 
webrtc_streaming::SensorsHandlersensors_handler_
 
std::shared_ptr< webrtc_streaming::LightsObserverlights_observer_
 
int sensors_subscription_id = -1
 
int lights_subscription_id_ = -1
 

Detailed Description

connection observer implementation for regular android mode. i.e. when it is not in the confirmation UI mode (or TEE), the control flow will fall back to this ConnectionObserverForAndroid

Constructor & Destructor Documentation

◆ ConnectionObserverImpl()

cuttlefish::ConnectionObserverImpl::ConnectionObserverImpl ( std::unique_ptr< InputConnector::EventSink input_events_sink,
KernelLogEventsHandler kernel_log_events_handler,
std::map< std::string, SharedFD commands_to_custom_action_servers,
std::weak_ptr< DisplayHandler display_handler,
CameraController camera_controller,
webrtc_streaming::SensorsHandler sensors_handler,
std::shared_ptr< webrtc_streaming::LightsObserver lights_observer 
)
inline

◆ ~ConnectionObserverImpl()

virtual cuttlefish::ConnectionObserverImpl::~ConnectionObserverImpl ( )
inlinevirtual

Member Function Documentation

◆ HandleDisplayAddMessage()

Result< void > cuttlefish::ConnectionObserverImpl::HandleDisplayAddMessage ( const Json::Value &  msg)
inline

◆ HandleDisplayRemoveMessage()

Result< void > cuttlefish::ConnectionObserverImpl::HandleDisplayRemoveMessage ( const Json::Value &  msg)
inline

◆ OnAdbChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnAdbChannelOpen ( std::function< bool(const uint8_t *, size_t)>  adb_message_sender)
inlineoverridevirtual

◆ OnAdbMessage()

void cuttlefish::ConnectionObserverImpl::OnAdbMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnBackButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnBackButton ( bool  button_down)
inlineoverridevirtual

◆ OnBluetoothChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnBluetoothChannelOpen ( std::function< bool(const uint8_t *, size_t)>  bluetooth_message_sender)
inlineoverridevirtual

◆ OnBluetoothMessage()

void cuttlefish::ConnectionObserverImpl::OnBluetoothMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnCameraControlMsg()

void cuttlefish::ConnectionObserverImpl::OnCameraControlMsg ( const Json::Value &  msg)
inlineoverridevirtual

◆ OnCameraData()

void cuttlefish::ConnectionObserverImpl::OnCameraData ( const std::vector< char > &  data)
inlineoverridevirtual

◆ OnConnected()

void cuttlefish::ConnectionObserverImpl::OnConnected ( )
inlineoverridevirtual

◆ OnControlChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnControlChannelOpen ( std::function< bool(const Json::Value)>  control_message_sender)
inlineoverridevirtual

◆ OnCustomActionButton()

void cuttlefish::ConnectionObserverImpl::OnCustomActionButton ( const std::string &  command,
const std::string &  button_state 
)
inlineoverridevirtual

◆ OnDisplayAddMsg()

void cuttlefish::ConnectionObserverImpl::OnDisplayAddMsg ( const Json::Value &  msg)
inlineoverridevirtual

◆ OnDisplayControlMsg()

void cuttlefish::ConnectionObserverImpl::OnDisplayControlMsg ( const Json::Value &  msg)
inlineoverridevirtual

◆ OnDisplayRemoveMsg()

void cuttlefish::ConnectionObserverImpl::OnDisplayRemoveMsg ( const Json::Value &  msg)
inlineoverridevirtual

◆ OnGamepadKeyEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnGamepadKeyEvent ( int  button,
bool  down 
)
inlineoverridevirtual

◆ OnGamepadMotionEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnGamepadMotionEvent ( int  code,
int  value 
)
inlineoverridevirtual

◆ OnGpxLocationsChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnGpxLocationsChannelOpen ( std::function< bool(const uint8_t *, size_t)>  gpx_locations_message_sender)
inlineoverridevirtual

◆ OnGpxLocationsMessage()

void cuttlefish::ConnectionObserverImpl::OnGpxLocationsMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnHingeAngleChange()

void cuttlefish::ConnectionObserverImpl::OnHingeAngleChange ( int  )
inlineoverridevirtual

◆ OnHomeButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnHomeButton ( bool  button_down)
inlineoverridevirtual

◆ OnKeyboardEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnKeyboardEvent ( uint16_t  code,
bool  down 
)
inlineoverridevirtual

◆ OnKmlLocationsChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnKmlLocationsChannelOpen ( std::function< bool(const uint8_t *, size_t)>  kml_locations_message_sender)
inlineoverridevirtual

◆ OnKmlLocationsMessage()

void cuttlefish::ConnectionObserverImpl::OnKmlLocationsMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnLidStateChange()

Result< void > cuttlefish::ConnectionObserverImpl::OnLidStateChange ( bool  lid_open)
inlineoverridevirtual

◆ OnLightsChannelClosed()

void cuttlefish::ConnectionObserverImpl::OnLightsChannelClosed ( )
inlineoverridevirtual

◆ OnLightsChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnLightsChannelOpen ( std::function< bool(const Json::Value &)>  lights_message_sender)
inlineoverridevirtual

◆ OnLocationChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnLocationChannelOpen ( std::function< bool(const uint8_t *, size_t)>  location_message_sender)
inlineoverridevirtual

◆ OnLocationMessage()

void cuttlefish::ConnectionObserverImpl::OnLocationMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnMenuButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnMenuButton ( bool  button_down)
inlineoverridevirtual

◆ OnMouseButtonEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnMouseButtonEvent ( int  button,
bool  down 
)
inlineoverridevirtual

◆ OnMouseMoveEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnMouseMoveEvent ( int  x,
int  y 
)
inlineoverridevirtual

◆ OnMouseWheelEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnMouseWheelEvent ( int  pixels)
inlineoverridevirtual

◆ OnMultiTouchEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnMultiTouchEvent ( const std::string &  device_label,
Json::Value  id,
Json::Value  x,
Json::Value  y,
bool  down,
int  size 
)
inlineoverridevirtual

◆ OnPowerButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnPowerButton ( bool  button_down)
inlineoverridevirtual

◆ OnRotaryWheelEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnRotaryWheelEvent ( int  pixels)
inlineoverridevirtual

◆ OnSensorsChannelClosed()

void cuttlefish::ConnectionObserverImpl::OnSensorsChannelClosed ( )
inlineoverridevirtual

◆ OnSensorsChannelOpen()

void cuttlefish::ConnectionObserverImpl::OnSensorsChannelOpen ( std::function< bool(const uint8_t *, size_t)>  sensors_message_sender)
inlineoverridevirtual

◆ OnSensorsMessage()

void cuttlefish::ConnectionObserverImpl::OnSensorsMessage ( const uint8_t *  msg,
size_t  size 
)
inlineoverridevirtual

◆ OnSwitchEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnSwitchEvent ( uint16_t  code,
bool  state 
)
inline

◆ OnTouchEvent()

Result< void > cuttlefish::ConnectionObserverImpl::OnTouchEvent ( const std::string &  device_label,
int  x,
int  y,
bool  down 
)
inlineoverridevirtual

◆ OnVolumeDownButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnVolumeDownButton ( bool  button_down)
inlineoverridevirtual

◆ OnVolumeUpButton()

Result< void > cuttlefish::ConnectionObserverImpl::OnVolumeUpButton ( bool  button_down)
inlineoverridevirtual

◆ SendLastFrameAsync()

void cuttlefish::ConnectionObserverImpl::SendLastFrameAsync ( std::optional< uint32_t >  display_number)
inlineprivate

Member Data Documentation

◆ adb_handler_

std::shared_ptr<webrtc_streaming::AdbHandler> cuttlefish::ConnectionObserverImpl::adb_handler_
private

◆ bluetooth_handler_

std::shared_ptr<webrtc_streaming::BluetoothHandler> cuttlefish::ConnectionObserverImpl::bluetooth_handler_
private

◆ camera_controller_

CameraController* cuttlefish::ConnectionObserverImpl::camera_controller_
private

◆ commands_to_custom_action_servers_

std::map<std::string, SharedFD> cuttlefish::ConnectionObserverImpl::commands_to_custom_action_servers_
private

◆ gpx_locations_handler_

std::shared_ptr<webrtc_streaming::GpxLocationsHandler> cuttlefish::ConnectionObserverImpl::gpx_locations_handler_
private

◆ input_events_sink_

std::unique_ptr<InputConnector::EventSink> cuttlefish::ConnectionObserverImpl::input_events_sink_
private

◆ kernel_log_events_handler_

KernelLogEventsHandler& cuttlefish::ConnectionObserverImpl::kernel_log_events_handler_
private

◆ kernel_log_subscription_id_

int cuttlefish::ConnectionObserverImpl::kernel_log_subscription_id_ = -1
private

◆ kml_locations_handler_

std::shared_ptr<webrtc_streaming::KmlLocationsHandler> cuttlefish::ConnectionObserverImpl::kml_locations_handler_
private

◆ lights_observer_

std::shared_ptr<webrtc_streaming::LightsObserver> cuttlefish::ConnectionObserverImpl::lights_observer_
private

◆ lights_subscription_id_

int cuttlefish::ConnectionObserverImpl::lights_subscription_id_ = -1
private

◆ location_handler_

std::shared_ptr<webrtc_streaming::LocationHandler> cuttlefish::ConnectionObserverImpl::location_handler_
private

◆ sensors_handler_

webrtc_streaming::SensorsHandler& cuttlefish::ConnectionObserverImpl::sensors_handler_
private

◆ sensors_subscription_id

int cuttlefish::ConnectionObserverImpl::sensors_subscription_id = -1
private

◆ weak_display_handler_

std::weak_ptr<DisplayHandler> cuttlefish::ConnectionObserverImpl::weak_display_handler_
private

The documentation for this class was generated from the following file: