(&self, serial: &str)
| 889 | } |
| 890 | |
| 891 | fn avd_name_for_serial(&self, serial: &str) -> Option<String> { |
| 892 | for property in ["ro.boot.qemu.avd_name", "ro.kernel.qemu.avd_name"] { |
| 893 | if let Ok(output) = self.run_adb(["-s", serial, "shell", "getprop", property]) { |
| 894 | let name = output.trim(); |
| 895 | if !name.is_empty() { |
| 896 | return Some(name.to_owned()); |
| 897 | } |
| 898 | } |
| 899 | } |
| 900 | self.run_adb(["-s", serial, "emu", "avd", "name"]) |
| 901 | .ok() |
| 902 | .and_then(|output| { |
| 903 | output |
| 904 | .lines() |
| 905 | .map(str::trim) |
| 906 | .find(|line| !line.is_empty() && *line != "OK") |
| 907 | .map(ToOwned::to_owned) |
| 908 | }) |
| 909 | } |
| 910 | |
| 911 | fn console_port_for_avd(&self, avd_name: &str) -> Result<u16, AppError> { |
| 912 | static CACHE: OnceLock<Mutex<TimedMap<u16>>> = OnceLock::new(); |
no test coverage detected