(
device: DeviceInfo,
action: AlertAction,
options: { timeoutMs?: number } = {},
)
| 45 | }; |
| 46 | |
| 47 | export async function handleAndroidAlert( |
| 48 | device: DeviceInfo, |
| 49 | action: AlertAction, |
| 50 | options: { timeoutMs?: number } = {}, |
| 51 | ): Promise<AndroidAlertResult> { |
| 52 | if (action === 'wait') { |
| 53 | return await waitForAndroidAlert(device, options.timeoutMs ?? DEFAULT_ALERT_TIMEOUT_MS); |
| 54 | } |
| 55 | if (action === 'get') { |
| 56 | const candidate = await readAndroidAlertCandidate(device); |
| 57 | return buildAndroidAlertStatusResponse(candidate?.alert ?? null); |
| 58 | } |
| 59 | return await handleAndroidAlertAction(device, action); |
| 60 | } |
| 61 | |
| 62 | async function waitForAndroidAlert( |
| 63 | device: DeviceInfo, |
no test coverage detected