MCPcopy Index your code
hub / github.com/callstack/agent-device / handleAndroidAlert

Function handleAndroidAlert

src/platforms/android/alert.ts:47–60  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  action: AlertAction,
  options: { timeoutMs?: number } = {},
)

Source from the content-addressed store, hash-verified

45 };
46
47export 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
62async function waitForAndroidAlert(
63 device: DeviceInfo,

Callers 1

handleAlertCommandFunction · 0.90

Calls 4

waitForAndroidAlertFunction · 0.85
handleAndroidAlertActionFunction · 0.85

Tested by

no test coverage detected