Companion app for QuestNav that prevents Meta Quest headsets from sleeping.
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.
A foreground service (KeepAwakeService) auto-starts on boot and does the following:
- Acquires a
PARTIAL_WAKE_LOCK - Writes system settings:
screen_off_timeout=MAX,stay_on_while_plugged_in=3,adaptive_sleep=-1,sleep_timeout=-1,wake_gesture_enabled=0 - Sends
com.oculus.vrpowermanager.prox_closebroadcasts every 2 seconds, which tellsVrPowerManagerServicethe headset is on-face. On Quest 3, this counteracts the proximity sensor. On Quest 3S, this resets the internal inactivity timers.
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.
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/.MainActivityAfter reboot, the service auto-starts.
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.apkprox_closemay stop working if Meta changesVrPowerManagerServicein a future firmware update.- Quest 3 fallback: tape over the proximity sensor if
prox_closeis ignored. - Quest 3S fallback: none known if
prox_closestops resetting sleep timers.
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