(&self, udid: &str, client_id: &str)
| 287 | } |
| 288 | |
| 289 | pub fn remove(&self, udid: &str, client_id: &str) -> (bool, bool) { |
| 290 | let now = Instant::now(); |
| 291 | let mut clients = self |
| 292 | .inner |
| 293 | .lock() |
| 294 | .unwrap_or_else(|poisoned| poisoned.into_inner()); |
| 295 | clients.retain(|_, state| { |
| 296 | now.duration_since(state.updated_at) <= STREAM_CLIENT_FOREGROUND_TTL |
| 297 | }); |
| 298 | let previous = any_foreground_client_for_udid(&clients, udid); |
| 299 | clients.remove(&(udid.to_owned(), client_id.to_owned())); |
| 300 | let next = any_foreground_client_for_udid(&clients, udid).unwrap_or(false); |
| 301 | (next, previous != Some(next)) |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | fn any_foreground_client_for_udid( |
nothing calls this directly
no test coverage detected