Skip to content

QuestNav/QuestNavKeepAwake

Repository files navigation

QuestNav KeepAwake

Companion app for QuestNav that prevents Meta Quest headsets from sleeping.

Background

Meta Quest headsets aggressively sleep using low-level mechanisms that standard Android settings (screen_off_timeout, stay_on_while_plugged_in) cannot override.

Both the Quest 3 and Quest 3S use an internal timer that starts when the headset is stationary. The IMU and SLAM tracking cameras determine motion. Near-zero IMU motion or occluded cameras (bag, face-down on table) trigger sleep after a few seconds. The Quest 3 also has a proximity sensor between the lenses that detects headset removal, adding an additional input to the sleep decision. VrPowerManagerService sleeps the device ~17 seconds after PROX_OFF.

How it works

A foreground service (KeepAwakeService) auto-starts on boot and does the following:

  1. Acquires a PARTIAL_WAKE_LOCK
  2. Writes system settings: screen_off_timeout=MAX, stay_on_while_plugged_in=3, adaptive_sleep=-1, sleep_timeout=-1, wake_gesture_enabled=0
  3. Sends com.oculus.vrpowermanager.prox_close broadcasts every 2 seconds, which tells VrPowerManagerService the headset is on-face. On Quest 3, this counteracts the proximity sensor. On Quest 3S, this resets the internal inactivity timers.

QuestNav coexistence

The prox_close broadcasts do not steal VR focus from QuestNav. When the headset is being worn and QuestNav is running, the system already considers the headset on-face, so the broadcasts are effectively no-ops.

Install (once per headset)

adb install app-debug.apk
adb shell pm grant com.questnav.keepawake android.permission.WRITE_SECURE_SETTINGS
adb shell am start -n com.questnav.keepawake/.MainActivity

After reboot, the service auto-starts.

Build

Requires Java 17 and Android SDK (API 33, Build Tools 33.0.2).

cd QuestNavKeepAwake
./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apk

Limitations

  • prox_close may stop working if Meta changes VrPowerManagerService in a future firmware update.
  • Quest 3 fallback: tape over the proximity sensor if prox_close is ignored.
  • Quest 3S fallback: none known if prox_close stops resetting sleep timers.

Project structure

app/src/main/
  AndroidManifest.xml
  java/com/questnav/keepawake/
    KeepAwakeService.java   # Foreground service: wake lock, settings, prox_close loop
    BootReceiver.java       # Starts service on BOOT_COMPLETED
    MainActivity.java       # Start/stop toggle UI
  res/
    layout/activity_main.xml
    values/strings.xml
    drawable/ic_launcher.xml

About

Companion app for QuestNav that prevents Meta Quest headsets from sleeping.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages