Loading system/gd/rust/linux/stack/src/bluetooth_media.rs +28 −6 Original line number Diff line number Diff line Loading @@ -849,12 +849,14 @@ impl BluetoothMedia { if let Some(uhid) = self.uhid.get_mut(&addr) { if volume == 0 && !uhid.muted { uhid.muted = true; // We expect the application to send back UHID output report and // update uhid.mute in dispatch_uhid_hfp_output_callback later. self.uhid_send_phone_mute_input_report(&addr, true); } else if volume > 0 { uhid.volume = volume; if uhid.muted { uhid.muted = false; // We expect the application to send back UHID output report and // update uhid.mute in dispatch_uhid_hfp_output_callback later. self.uhid_send_phone_mute_input_report(&addr, false); } } Loading Loading @@ -1005,9 +1007,19 @@ impl BluetoothMedia { warn!("Unexpected answer call. phone_ops_enabled and mps_qualification_enabled does not enabled."); return; } self.answer_call_impl(); if self.mps_qualification_enabled { // In qualification mode we expect no application to interact with. // So we just jump right in to the telephony ops implementation. let id = BLUETOOTH_TELEPHONY_UHID_REPORT_ID; let mut data = UHID_OUTPUT_NONE; data |= UHID_OUTPUT_OFF_HOOK; self.dispatch_uhid_hfp_output_callback(addr.to_string(), id, data); } else { // We expect the application to send back UHID output report and // trigger dispatch_uhid_hfp_output_callback later. self.uhid_send_hook_switch_input_report(&addr, true); } } HfpCallbacks::HangupCall(addr) => { if !self.phone_ops_enabled && !self.mps_qualification_enabled { warn!("Unexpected hangup call. phone_ops_enabled and mps_qualification_enabled does not enabled."); Loading @@ -1022,9 +1034,19 @@ impl BluetoothMedia { ); return; } self.hangup_call_impl(); if self.mps_qualification_enabled { // In qualification mode we expect no application to interact with. // So we just jump right in to the telephony ops implementation. let id = BLUETOOTH_TELEPHONY_UHID_REPORT_ID; let mut data = UHID_OUTPUT_NONE; data &= !UHID_OUTPUT_OFF_HOOK; self.dispatch_uhid_hfp_output_callback(addr.to_string(), id, data); } else { // We expect the application to send back UHID output report and // trigger dispatch_uhid_hfp_output_callback later. self.uhid_send_hook_switch_input_report(&addr, false); } } HfpCallbacks::DialCall(number, addr) => { if !self.mps_qualification_enabled { warn!("Unexpected dail call. mps_qualification_enabled does not enabled."); Loading Loading
system/gd/rust/linux/stack/src/bluetooth_media.rs +28 −6 Original line number Diff line number Diff line Loading @@ -849,12 +849,14 @@ impl BluetoothMedia { if let Some(uhid) = self.uhid.get_mut(&addr) { if volume == 0 && !uhid.muted { uhid.muted = true; // We expect the application to send back UHID output report and // update uhid.mute in dispatch_uhid_hfp_output_callback later. self.uhid_send_phone_mute_input_report(&addr, true); } else if volume > 0 { uhid.volume = volume; if uhid.muted { uhid.muted = false; // We expect the application to send back UHID output report and // update uhid.mute in dispatch_uhid_hfp_output_callback later. self.uhid_send_phone_mute_input_report(&addr, false); } } Loading Loading @@ -1005,9 +1007,19 @@ impl BluetoothMedia { warn!("Unexpected answer call. phone_ops_enabled and mps_qualification_enabled does not enabled."); return; } self.answer_call_impl(); if self.mps_qualification_enabled { // In qualification mode we expect no application to interact with. // So we just jump right in to the telephony ops implementation. let id = BLUETOOTH_TELEPHONY_UHID_REPORT_ID; let mut data = UHID_OUTPUT_NONE; data |= UHID_OUTPUT_OFF_HOOK; self.dispatch_uhid_hfp_output_callback(addr.to_string(), id, data); } else { // We expect the application to send back UHID output report and // trigger dispatch_uhid_hfp_output_callback later. self.uhid_send_hook_switch_input_report(&addr, true); } } HfpCallbacks::HangupCall(addr) => { if !self.phone_ops_enabled && !self.mps_qualification_enabled { warn!("Unexpected hangup call. phone_ops_enabled and mps_qualification_enabled does not enabled."); Loading @@ -1022,9 +1034,19 @@ impl BluetoothMedia { ); return; } self.hangup_call_impl(); if self.mps_qualification_enabled { // In qualification mode we expect no application to interact with. // So we just jump right in to the telephony ops implementation. let id = BLUETOOTH_TELEPHONY_UHID_REPORT_ID; let mut data = UHID_OUTPUT_NONE; data &= !UHID_OUTPUT_OFF_HOOK; self.dispatch_uhid_hfp_output_callback(addr.to_string(), id, data); } else { // We expect the application to send back UHID output report and // trigger dispatch_uhid_hfp_output_callback later. self.uhid_send_hook_switch_input_report(&addr, false); } } HfpCallbacks::DialCall(number, addr) => { if !self.mps_qualification_enabled { warn!("Unexpected dail call. mps_qualification_enabled does not enabled."); Loading