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

Function readAndroidFocus

src/platforms/android/app-lifecycle.ts:232–243  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  commands: string[][],
)

Source from the content-addressed store, hash-verified

230}
231
232async function readAndroidFocus(
233 device: DeviceInfo,
234 commands: string[][],
235): Promise<AndroidForegroundApp | null> {
236 for (const args of commands) {
237 const result = await runAndroidAdb(device, args, { allowFailure: true });
238 const text = result.stdout ?? '';
239 const parsed = parseAndroidForegroundApp(text);
240 if (parsed) return parsed;
241 }
242 return null;
243}
244
245async function readAndroidBlockingDialogFocus(
246 device: DeviceInfo,

Callers 1

getAndroidAppStateFunction · 0.85

Calls 2

runAndroidAdbFunction · 0.90

Tested by

no test coverage detected