(state: AppState, udid: String)
| 5544 | } |
| 5545 | |
| 5546 | async fn android_simulator_payload(state: AppState, udid: String) -> Result<Json<Value>, AppError> { |
| 5547 | let android_devices = |
| 5548 | run_android_action(state.clone(), |android| android.list_devices()).await?; |
| 5549 | let simulator = state |
| 5550 | .android |
| 5551 | .enrich_devices(android_devices) |
| 5552 | .into_iter() |
| 5553 | .find(|entry| entry.get("udid").and_then(Value::as_str) == Some(udid.as_str())) |
| 5554 | .ok_or_else(|| AppError::not_found(format!("Unknown Android emulator {udid}")))?; |
| 5555 | Ok(json(json_value!({ "simulator": simulator }))) |
| 5556 | } |
| 5557 | |
| 5558 | async fn simulator_payload(state: AppState, udid: String) -> Result<Json<Value>, AppError> { |
| 5559 | if android::is_android_id(&udid) { |
no test coverage detected