(
State(state): State<AppState>,
Path(udid): Path<String>,
Query(query): Query<ChromePngQuery>,
)
| 3212 | } |
| 3213 | |
| 3214 | async fn chrome_png( |
| 3215 | State(state): State<AppState>, |
| 3216 | Path(udid): Path<String>, |
| 3217 | Query(query): Query<ChromePngQuery>, |
| 3218 | ) -> Result<(StatusCode, HeaderMap, Vec<u8>), AppError> { |
| 3219 | if android::is_android_id(&udid) { |
| 3220 | return Err(AppError::not_found( |
| 3221 | "Android emulators do not expose device chrome assets.", |
| 3222 | )); |
| 3223 | } |
| 3224 | let include_buttons = query |
| 3225 | .buttons |
| 3226 | .as_deref() |
| 3227 | .map(|value| !value.eq_ignore_ascii_case("false")) |
| 3228 | .unwrap_or(true); |
| 3229 | let png = run_bridge_action(state, move |bridge| { |
| 3230 | bridge.chrome_png_with_buttons(&udid, include_buttons) |
| 3231 | }) |
| 3232 | .await?; |
| 3233 | let headers = chrome_asset_headers(); |
| 3234 | Ok((StatusCode::OK, headers, png)) |
| 3235 | } |
| 3236 | |
| 3237 | fn parse_asset_bool(value: &str) -> bool { |
| 3238 | matches!( |
nothing calls this directly
no test coverage detected