ReviewOS

also looking at this

craft-native/craft

feat(maps): add key-free native Android maps and shared map controls

#363
Merged chris wants to merge codex/wildloop-native-map-providers into main
28 files +1857 -481

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

packages/android/src/emulator.tsmodified+3-8
Changes to packages/android/src/emulator.ts
@@ -12,8 +12,6 @@ export interface AndroidEmulatorOptions {
1212 temporaryDirectory?: string
1313 port?: number
1414 acceptLicenses?: boolean
15 /** Readiness budget in milliseconds, from 1 second to 30 minutes; defaults to 10 minutes. */
16 bootTimeoutMs?: number
1715 env?: Record<string, string | undefined>
1816}
1917
@@ -35,9 +33,6 @@ export async function createAndroidEmulator(options: AndroidEmulatorOptions): Pr
3533 throw new Error('The Android system image must match the host architecture')
3634 if (options.acceleration === 'software' && process.arch !== 'x64')
3735 throw new Error('Android software emulation requires an x86_64 host and system image')
38 const bootTimeoutMs = options.bootTimeoutMs ?? 600_000
39 if (!Number.isSafeInteger(bootTimeoutMs) || bootTimeoutMs < 1000 || bootTimeoutMs > 1_800_000)
40 throw new Error('Android bootTimeoutMs must be between 1000 and 1800000 milliseconds')
4136 const port = options.port ?? 5558
4237 if (!Number.isInteger(port) || port < 5554 || port > 5682 || port % 2 !== 0) throw new Error('Android console ports must be even and between 5554 and 5682')
4338 const sdk = resolve(options.sdkRoot)
@@ -108,9 +103,9 @@ export async function createAndroidEmulator(options: AndroidEmulatorOptions): Pr
108103 created = true
109104 log = openSync(join(artifacts, 'emulator.log'), 'w')
110105 child = Bun.spawn([executable, '-avd', name, '-port', String(port), '-no-window', '-no-snapshot', '-no-audio', '-no-boot-anim', '-gpu', 'software', '-memory', '2048', '-cores', '2', '-accel', options.acceleration === 'software' ? 'off' : 'on'], { env, stdout: log, stderr: log })
111 const identity = { image: options.image, acceleration: options.acceleration, bootTimeoutMs, accelerationProbeExitCode: acceleration.code, serial, avdDirectory: env.ANDROID_AVD_HOME, emulatorPid: child.pid }
106 const identity = { image: options.image, acceleration: options.acceleration, accelerationProbeExitCode: acceleration.code, serial, avdDirectory: env.ANDROID_AVD_HOME, emulatorPid: child.pid }
112107 await Bun.write(join(artifacts, 'android-emulator.json'), JSON.stringify(identity, null, 2) + '\n')
113 const deadline = Date.now() + bootTimeoutMs
108 const deadline = Date.now() + 600_000
114109 while (Date.now() < deadline && child.exitCode === null) {
115110 let booted = false
116111 // Nonzero ADB exits are expected while services initialize. Filesystem,
@@ -137,7 +132,7 @@ export async function createAndroidEmulator(options: AndroidEmulatorOptions): Pr
137132 }
138133 await Bun.sleep(2000)
139134 }
140 throw new Error(`The owned Android emulator did not boot within ${bootTimeoutMs}ms; inspect ${artifacts}`)
135 throw new Error(`The owned Android emulator did not boot; inspect ${artifacts}`)
141136 }
142137 catch (error) {
143138 if (child) {