(ms = 8000, step = 60)
| 505 | const isAndroid = !!(App && (App as any).android !== undefined); |
| 506 | if (isAndroid) { |
| 507 | const ready = async (ms = 8000, step = 60) => { |
| 508 | const start = Date.now(); |
| 509 | const ok = () => { |
| 510 | try { |
| 511 | const a = (App as any).android; |
| 512 | const act = a && (a.foregroundActivity || a.startActivity); |
| 513 | const inProg = !!g.__NS_DEV_RESET_IN_PROGRESS__; |
| 514 | return !!act && !inProg; |
| 515 | } catch { |
| 516 | return false; |
| 517 | } |
| 518 | }; |
| 519 | while (Date.now() - start < ms) { |
| 520 | if (ok()) return true; |
| 521 | await new Promise((r) => setTimeout(r, step)); |
| 522 | } |
| 523 | return ok(); |
| 524 | }; |
| 525 | const ok = await ready(8000, 60); |
| 526 | if (!ok && VERBOSE) console.warn('[hmr][init] proceeding without explicit boot-ready signal (timeout)'); |
| 527 | } |
no test coverage detected