( device: DeviceInfo, timeoutMs: number, )
| 107 | } |
| 108 | |
| 109 | async function pollAndroidAlertCandidate( |
| 110 | device: DeviceInfo, |
| 111 | timeoutMs: number, |
| 112 | ): Promise<AndroidAlertCandidate | null> { |
| 113 | const start = Date.now(); |
| 114 | while (Date.now() - start < timeoutMs) { |
| 115 | const candidate = await readAndroidAlertCandidate(device); |
| 116 | if (candidate) return candidate; |
| 117 | await sleep(ALERT_POLL_INTERVAL_MS); |
| 118 | } |
| 119 | return null; |
| 120 | } |
| 121 | |
| 122 | async function readAndroidAlertCandidate( |
| 123 | device: DeviceInfo, |
no test coverage detected