Loading system/gd/rust/linux/stack/src/bluetooth_media.rs +3 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,9 @@ impl BluetoothMedia { Err(e) => warn!("{}", e), } } AvrcpCallbacks::AvrcpSetActiveDevice(addr) => { self.uinput.set_active_device(addr.to_string()); } } } Loading system/gd/rust/topshim/btav/btav_shim.cc +4 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,10 @@ class AvrcpMediaInterfaceImpl : public MediaInterface { [[maybe_unused]] bool now_playing, [[maybe_unused]] std::string media_id) override {} void SetActiveDevice([[maybe_unused]] const RawAddress& address) override {} void SetActiveDevice(const RawAddress& address) override { topshim::rust::RustRawAddress addr = rusty::CopyToRustAddress(address); rusty::avrcp_set_active_device(addr); } }; class VolumeInterfaceImpl : public VolumeInterface { Loading system/gd/rust/topshim/src/profiles/avrcp.rs +11 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ pub mod ffi { fn avrcp_device_disconnected(addr: RustRawAddress); fn avrcp_absolute_volume_update(volume: u8); fn avrcp_send_key_event(key: u8, state: u8); fn avrcp_set_active_device(addr: RustRawAddress); } } Loading Loading @@ -59,6 +60,9 @@ pub enum AvrcpCallbacks { /// Emitted when received a key event from a connected AVRCP device /// Params: Key, Value AvrcpSendKeyEvent(u8, u8), /// Emitted when received request from AVRCP interface to set a device to active /// Params: Device address AvrcpSetActiveDevice(RawAddress), } pub struct AvrcpCallbacksDispatcher { Loading Loading @@ -93,6 +97,13 @@ cb_variant!( u8, u8, {} ); cb_variant!( AvrcpCb, avrcp_set_active_device -> AvrcpCallbacks::AvrcpSetActiveDevice, ffi::RustRawAddress -> RawAddress, { let _0 = _0.into(); }); pub struct Avrcp { internal: cxx::UniquePtr<ffi::AvrcpIntf>, _is_init: bool, Loading Loading
system/gd/rust/linux/stack/src/bluetooth_media.rs +3 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,9 @@ impl BluetoothMedia { Err(e) => warn!("{}", e), } } AvrcpCallbacks::AvrcpSetActiveDevice(addr) => { self.uinput.set_active_device(addr.to_string()); } } } Loading
system/gd/rust/topshim/btav/btav_shim.cc +4 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,10 @@ class AvrcpMediaInterfaceImpl : public MediaInterface { [[maybe_unused]] bool now_playing, [[maybe_unused]] std::string media_id) override {} void SetActiveDevice([[maybe_unused]] const RawAddress& address) override {} void SetActiveDevice(const RawAddress& address) override { topshim::rust::RustRawAddress addr = rusty::CopyToRustAddress(address); rusty::avrcp_set_active_device(addr); } }; class VolumeInterfaceImpl : public VolumeInterface { Loading
system/gd/rust/topshim/src/profiles/avrcp.rs +11 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ pub mod ffi { fn avrcp_device_disconnected(addr: RustRawAddress); fn avrcp_absolute_volume_update(volume: u8); fn avrcp_send_key_event(key: u8, state: u8); fn avrcp_set_active_device(addr: RustRawAddress); } } Loading Loading @@ -59,6 +60,9 @@ pub enum AvrcpCallbacks { /// Emitted when received a key event from a connected AVRCP device /// Params: Key, Value AvrcpSendKeyEvent(u8, u8), /// Emitted when received request from AVRCP interface to set a device to active /// Params: Device address AvrcpSetActiveDevice(RawAddress), } pub struct AvrcpCallbacksDispatcher { Loading Loading @@ -93,6 +97,13 @@ cb_variant!( u8, u8, {} ); cb_variant!( AvrcpCb, avrcp_set_active_device -> AvrcpCallbacks::AvrcpSetActiveDevice, ffi::RustRawAddress -> RawAddress, { let _0 = _0.into(); }); pub struct Avrcp { internal: cxx::UniquePtr<ffi::AvrcpIntf>, _is_init: bool, Loading