Originally answered on Quora: "Why does my Android camera stop recording when the screen turns off, and how do I keep it running?" (Super Funicular, 2026-05-21). This is the dev.to canonical — the long, mechanism-level version of the same answer, written for developers shipping a camera-adjacent Android app and for owners who want to understand the OS behavior before, or instead of, writing code. If you've ever set your Android phone down as a home security camera, locked the screen, and walked away — only to discover later that the recording stopped fifteen minutes after you left — you've met the real adversary of Android background recording: Doze Mode . Not the camera API. Not the codec. Not the storage. Doze. This is the question-the-mechanism essay.…