(udid: &str, ttl: Duration)
| 4352 | } |
| 4353 | |
| 4354 | fn cached_foreground_app_with_ttl(udid: &str, ttl: Duration) -> Option<devtools::ForegroundApp> { |
| 4355 | let cache = FOREGROUND_APP_CACHE.get()?; |
| 4356 | let Ok(cache) = cache.lock() else { |
| 4357 | return None; |
| 4358 | }; |
| 4359 | let cached = cache.get(udid)?; |
| 4360 | (cached.cached_at.elapsed() <= ttl).then(|| cached.foreground_app.clone()) |
| 4361 | } |
| 4362 | |
| 4363 | #[derive(Clone, Debug)] |
| 4364 | struct UIKitApplicationService { |
no test coverage detected