(
&self,
serial: &str,
key_code: u16,
modifiers: u32,
)
| 518 | } |
| 519 | |
| 520 | fn press_android_key_combination( |
| 521 | &self, |
| 522 | serial: &str, |
| 523 | key_code: u16, |
| 524 | modifiers: u32, |
| 525 | ) -> Result<(), AppError> { |
| 526 | let mut parts = vec!["input".to_owned(), "keycombination".to_owned()]; |
| 527 | parts.extend( |
| 528 | android_modifier_key_codes(modifiers) |
| 529 | .into_iter() |
| 530 | .map(|key| key.to_string()), |
| 531 | ); |
| 532 | parts.push(key_code.to_string()); |
| 533 | match self.run_adb_shell(serial, &parts.join(" ")) { |
| 534 | Ok(_) => Ok(()), |
| 535 | Err(_) => self.press_android_key(serial, key_code), |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | pub fn press_home(&self, id: &str) -> Result<(), AppError> { |
| 540 | let serial = self.serial_for_id(id)?; |
no test coverage detected