Skip to content

perf(voice): run raise to talk motion only while the sensor is covered - #231

Merged
Tarquinen merged 2 commits into
devfrom
raise-to-talk-motion
Nov 22, 2026
Merged

Tarquinen merged 2 commits into
devfrom
raise-to-talk-motion

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Raise to Talk kept the gravity sensor running at 10 Hz the whole time a session screen was open with the setting on. Now it runs only from the moment the proximity sensor is covered until the raise is decided, and while the phone is at the ear. Posture is read from the first samples, 100 ms after the cover (or from the first sample to arrive, if the sensor starts slower), and again when the dwell ends. Ports iOS #313 (7393e966).

Verified with the full scripts/check.sh. The four ported IdleVoiceSensorsTests and the late-first-sample test fail without the change. On the emulator with faked sensors, dumpsys sensorservice shows only proximity while idle, gravity switching on with a cover and back off after the dwell when the phone lies flat, and an upright cover still raises.

Not tried on a real phone. How quickly a sensor delivers its first sample after starting depends on the device, and on phones without a gravity sensor the accelerometer fallback reads its first samples unfiltered.

Raise to Talk kept the gravity sensor on at 10 Hz for as long as the session
screen listened, though posture only matters once proximity is covered. Now
motion starts with the cover and stops once the raise is decided (a brief
cover, a refused raise, a flat phone) or the phone leaves the ear. The posture
as it's covered is read from motion's first samples, 100 ms in, and checked
again when the 600 ms dwell ends; a sample from before motion started is never
read. Ports iOS #313 (7393e966).

Verified: scripts/check.sh (full, on the Android VM); four ported
IdleVoiceSensorsTests fail on the old detector and pass now. On the emulator
with faked sensors (adb emu sensor set), dumpsys sensorservice shows only
proximity while idle, gravity on right after a cover, off again after the
dwell when flat, and an upright cover raises. Not checked on a real phone.
When the motion sensor starts cold, its first sample can land after the
100 ms posture check, which then had nothing to read and let the cover
through; a phone covered flat that turned upright within the dwell could
start a call that dev, with motion always warm, refused. Now a cover with no
sample at 100 ms takes its posture from the first sample that arrives.
The parity row now says the proximity refcount cases don't apply on Android
and the cover warming nudge is deferred.

Verified: scripts/check.sh (full, on the Android VM); the new
aFirstSampleLyingFlatAfterTheEarlyCheckIsNoRaise fails with the check
disabled and passes with it.
@Tarquinen
Tarquinen merged commit 1563fa5 into dev Nov 22, 2026
2 checks passed
@Tarquinen
Tarquinen deleted the raise-to-talk-motion branch November 22, 2026 18:28
CrashedSystem added a commit to CrashedSystem/opencode-android that referenced this pull request Nov 23, 2026
Upstream moved from d442dea (2026-11-21) to fc35d8f (2026-11-22). Merged with
no conflicts; every fork change survives (verified by grepping each: forkDebug
signing, RELAY_URL, session vibration, Firebase resources, Korean copy, the
Android home in AgentFileReference).

Upstream's seven:
- fc35d8f fix(app): stop WorkManager crashing at start while the user is locked (anomalyco#284)
- 1563fa5 perf(voice): run raise to talk motion only while the sensor is covered (anomalyco#231)
- 43defc2 fix(media): cap the media disk cache at 256 MiB (anomalyco#230)
- fad0873 fix(server): stop encoding an oversized transcript cache entry whole (anomalyco#285)
- fe3e324 fix(core): skip encoding in-memory shared keys (anomalyco#258)
- 2356197 fix(app): keep OkHttp's IDN table out of the hostname method (anomalyco#262)
- 67198a9 fix(transcript): merge inline runs in linear time (anomalyco#283)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant