Skip to content

Commit aedc56d

Browse files
committed
docs: clarify Android snapshot helper idle waits
1 parent 98376b9 commit aedc56d

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

android-snapshot-helper/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ The `-t` install flag is required because the helper is a test-only instrumentat
4343
Devices or providers that block test-package installs must allow this package before helper capture
4444
can run.
4545

46+
`waitForIdleTimeoutMs` defaults to `500`, which is a maximum wait, not a fixed sleep. Direct helper
47+
invocations can pass `0` when immediate capture during ongoing animation is preferred.
48+
4649
## Output Contract
4750

4851
The APK emits instrumentation status records using

android-snapshot-helper/src/main/java/com/callstack/agentdevice/snapshothelper/SnapshotInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public final class SnapshotInstrumentation extends Instrumentation {
3030
private static final String OUTPUT_FORMAT = "uiautomator-xml";
3131
private static final String HELPER_API_VERSION = "1";
3232
private static final int CHUNK_SIZE = 2 * 1024;
33-
// Match the host defaults: long enough to avoid mid-transition RN snapshots, but still bounded
34-
// below the stock uiautomator idle wait so busy apps do not stall every capture.
33+
// Match the host default: bounded wait for microinteraction reliability without the stock
34+
// uiautomator idle tax. Direct callers can pass 0 when immediate capture is preferred.
3535
private static final long DEFAULT_WAIT_FOR_IDLE_TIMEOUT_MS = 500;
3636
private static final long DEFAULT_WAIT_FOR_IDLE_QUIET_MS = 100;
3737
private static final long DEFAULT_TIMEOUT_MS = 8_000;

src/platforms/android/snapshot-helper-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export const ANDROID_SNAPSHOT_HELPER_RUNNER =
1818
'com.callstack.agentdevice.snapshothelper/.SnapshotInstrumentation';
1919
export const ANDROID_SNAPSHOT_HELPER_PROTOCOL = 'android-snapshot-helper-v1';
2020
export const ANDROID_SNAPSHOT_HELPER_OUTPUT_FORMAT = 'uiautomator-xml';
21+
// Keep common snapshots biased toward post-microinteraction reliability. The
22+
// value is a max wait; callers that need immediate capture can explicitly pass 0.
2123
export const ANDROID_SNAPSHOT_HELPER_WAIT_FOR_IDLE_TIMEOUT_MS = 500;
2224
export const ANDROID_SNAPSHOT_HELPER_WAIT_FOR_IDLE_QUIET_MS = 100;
2325
export const ANDROID_SNAPSHOT_HELPER_COMMAND_OVERHEAD_MS = 5_000;

0 commit comments

Comments
 (0)