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

Function ensureGenericCommandReady

src/daemon/request-generic-dispatch.ts:154–176  ·  view source on GitHub ↗
(
  session: SessionState,
  platformCommand: string,
)

Source from the content-addressed store, hash-verified

152}
153
154async function ensureGenericCommandReady(
155 session: SessionState,
156 platformCommand: string,
157): Promise<DaemonResponse | null> {
158 const unsupported = requireCommandSupported(platformCommand, session.device, { hint: true });
159 if (unsupported) return unsupported;
160 if (
161 session.device.platform !== 'android' ||
162 isActiveProviderDevice(session.device) ||
163 !session.recording ||
164 platformCommand === 'record' ||
165 (await recoverAndroidBlockingSystemDialog({ session })).status !== 'failed'
166 ) {
167 return null;
168 }
169 return {
170 ok: false,
171 error: {
172 code: 'COMMAND_FAILED',
173 message: 'Android system dialog blocked the recording session',
174 },
175 };
176}
177
178async function executeGenericPlatformCommand(params: {
179 session: SessionState;

Callers 1

dispatchGenericCommandFunction · 0.85

Calls 3

requireCommandSupportedFunction · 0.90
isActiveProviderDeviceFunction · 0.90

Tested by

no test coverage detected