rouse-context/device-tests
Jason Monk 1850a085f3 Fix device integration tests: manifest, permissions, and plain-HTTP relay
Three root causes prevented the wake flow test from passing:

1. TunnelForegroundService and FcmReceiver were not declared in the work
   module's AndroidManifest.xml, so Android couldn't find or start them.

2. ADB broadcasts to FirebaseInstanceIdReceiver require the C2DM sender
   permission, which the ADB shell (uid 2000) lacks. Added a debug-only
   TestWakeReceiver that starts TunnelForegroundService without requiring
   any sender permission.

3. The relay URL was hardcoded to wss:// but the test relay runs without
   TLS. Added configurable relay.scheme build property (defaults to wss,
   tests pass ws). The relay now injects a test DeviceIdentity when running
   without TLS so /ws accepts connections. Added cleartext network security
   config for debug builds.

Also fixed: TunnelForegroundService now catches connection errors instead
of crashing, and installApk() auto-uninstalls on signature mismatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:31:54 -04:00
..
src/test/kotlin/com/rousecontext/device Fix device integration tests: manifest, permissions, and plain-HTTP relay 2026-04-05 17:31:54 -04:00
build.gradle.kts Add device-tests module for end-to-end integration testing with real Android device 2026-04-05 15:31:03 -04:00