Skip to content

Keep a Meta Quest headset awake through the proximity override - #4

Merged
RangelReale merged 1 commit into
masterfrom
feature/quest-keep-awake
Nov 12, 2026
Merged

RangelReale merged 1 commit into
masterfrom
feature/quest-keep-awake

Conversation

@RangelReale

Copy link
Copy Markdown
Contributor

What changed

On a Meta Quest, Keep screen on becomes Keep headset awake:

  • KeepScreenOnService still holds the screen wake lock. On a Quest it also sends the com.oculus.vrpowermanager.prox_close broadcast when it starts and every minute after. When the timer ends or the user stops it, it sends com.oculus.vrpowermanager.automation_disable, so the proximity sensor works again.
  • The row title, its description and the notification title say "headset" on a Quest.
  • Stay awake while charging stays hidden on a Quest. The note saying both features were hidden is gone.
  • DevicePlatform replaces supportsKeepAwake with supportsStayAwake and needsProximityOverride. A new ProximityOverride object holds the broadcast actions and the renewal interval. Unit tests cover both.
  • The README's Meta Quest section describes the feature.

Phones behave exactly as before.

Why

A wake lock and stay_on_while_plugged_in don't stop the Quest's proximity sensor from putting the headset to sleep about 20 seconds after it is taken off. prox_close makes the headset act as if it is worn. Meta Quest Developer Hub's Proximity Sensor switch uses the same override.

On the Quest 3, both broadcasts are handled by receivers in system_server that require no permission, and neither action is a protected broadcast. Sent with an ordinary app's user ID, they kept the headset awake and released it.

Reviewer notes

  • These broadcasts come from Meta's testing tools and are not a supported API. A Horizon OS update could block them.
  • Meta says MQDH's override lapses about 10 minutes after MQDH disconnects, so the service renews it every minute.
  • If Android kills the process before onDestroy, the override stays on until it lapses or the headset restarts.
  • The headset uses more battery while the sensor is overridden.

Testing

  • ./gradlew testDebugUnitTest lintDebug assembleDebug passes.
  • On a Quest 3: the row reads "Keep headset awake" and Stay awake is gone. With a 5-minute timer and the headset off, the headset stayed awake until the timer ended (about 4 minutes off-head, so at least three renewals) and slept within 5 seconds after.

🤖 Generated with Claude Code

On a Quest, a screen wake lock does not stop the proximity sensor from
putting the headset to sleep when it is taken off. The
com.oculus.vrpowermanager.prox_close broadcast does: it makes the headset
act as if it is worn, needs no permission, and an ordinary app may send it.

On a Quest, Keep screen on becomes "Keep headset awake". The service sends
prox_close when it starts and every minute after, and automation_disable
when it stops, so the sensor works again. Tested on a Quest 3: with the
headset off, it stayed awake until the timer ended and slept seconds later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RangelReale
RangelReale merged commit 2d1399e into master Nov 12, 2026
1 check passed
@RangelReale
RangelReale deleted the feature/quest-keep-awake branch November 12, 2026 19:20
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