MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / chrome_png

Function chrome_png

packages/server/src/api/routes.rs:3214–3235  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    Path(udid): Path<String>,
    Query(query): Query<ChromePngQuery>,
)

Source from the content-addressed store, hash-verified

3212}
3213
3214async 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
3237fn parse_asset_bool(value: &str) -> bool {
3238 matches!(

Callers

nothing calls this directly

Calls 4

is_android_idFunction · 0.85
run_bridge_actionFunction · 0.85
chrome_asset_headersFunction · 0.85

Tested by

no test coverage detected