Doze starts when the phone is unplugged, stationary and dark for a while. It suspends network access, ignores wake locks, defers alarms and stops JobScheduler (and so WorkManager 234 ) until a brief maintenance window, and the windows grow further apart the longer the phone lies still. App Standby buckets throttle each app by how recently the user touched it: Active (10), Working set (20), Frequent (30), Rare (40, network limited too) and Restricted (45: jobs once a day in a 10-minute batch, one alarm a day). Users add Battery Saver and a per-app "Restricted" battery setting. You can't opt out, but you can test against it. With BookNest's 6-hour sync scheduled (Background Sync) and the app in the background:
adb shell dumpsys battery unplug
adb shell am set-standby-bucket com.example.booknest rare
adb shell dumpsys deviceidle force-idle
adb shell dumpsys jobscheduler # then find the app's jobNow forced in to deep idle mode
...
Satisfied constraints: BATTERY_NOT_LOW FLEXIBILITY BACKGROUND_NOT_RESTRICTED WITHIN_QUOTA
[0x1600002]
Unsatisfied constraints: TIMING_DELAY CONNECTIVITY [0x90000000]
readyNotDozing: false
Standby bucket: RAREDoze took the network away, so CONNECTIVITY failed with Wi-Fi up, and readyNotDozing: false holds the job back regardless. A first attempt, seconds after BookNest left the screen, still read DEVICE_NOT_DOZING satisfied and bucket ACTIVE, so give the system a moment before you check. Undo it all with deviceidle unforce, battery reset and set-standby-bucket ... active. And note that am force-stop, like the user's Force stop button, cancels every job and alarm the app has until it next starts.