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

Function clearFocusedText

src/platforms/android/input-actions.ts:398–414  ·  view source on GitHub ↗
(device: DeviceInfo, count: number)

Source from the content-addressed store, hash-verified

396}
397
398async function clearFocusedText(device: DeviceInfo, count: number): Promise<void> {
399 const deletes = Math.max(0, count);
400 await runAndroidAdb(device, ['shell', 'input', 'keyevent', 'KEYCODE_MOVE_END'], {
401 allowFailure: true,
402 });
403 const batchSize = 24;
404 for (let i = 0; i < deletes; i += batchSize) {
405 const size = Math.min(batchSize, deletes - i);
406 await runAndroidAdb(
407 device,
408 ['shell', 'input', 'keyevent', ...Array(size).fill('KEYCODE_DEL')],
409 {
410 allowFailure: true,
411 },
412 );
413 }
414}
415
416function clampCount(value: number, min: number, max: number): number {
417 return Math.max(min, Math.min(max, value));

Callers 1

fillAndroidFunction · 0.85

Calls 2

runAndroidAdbFunction · 0.90
fillMethod · 0.80

Tested by

no test coverage detected