( session: SessionState, platformCommand: string, )
| 152 | } |
| 153 | |
| 154 | async 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 | |
| 178 | async function executeGenericPlatformCommand(params: { |
| 179 | session: SessionState; |
no test coverage detected